Merge branch 'end-4:main' into kb_layout_multi_monitor

This commit is contained in:
Hossein Motahari
2024-08-04 17:01:41 +03:00
committed by GitHub
5 changed files with 29 additions and 14 deletions
@@ -250,8 +250,12 @@ export default ({
className: 'txt-smaller txt-semibold',
label: initTimeString,
setup: initTimeString == 'Now' ? (self) => {
Utils.timeout(60000, () => self.label = getFriendlyNotifTimeString(notifObject.time))
} : () => {},
let id = Utils.timeout(60000, () => {
self.label = getFriendlyNotifTimeString(notifObject.time);
id = null;
});
self.connect('destroy', () => { if (id) GLib.source_remove(id) });
} : () => { },
});
const notifText = Box({
valign: Gtk.Align.CENTER,
+16 -8
View File
@@ -28,16 +28,27 @@ const BarBatteryProgress = () => {
})
}
const time = Variable('', {
poll: [
userOptions.time.interval,
() => GLib.DateTime.new_now_local().format(userOptions.time.format),
],
})
const date = Variable('', {
poll: [
userOptions.time.dateInterval,
() => GLib.DateTime.new_now_local().format(userOptions.time.dateFormatLong),
],
})
const BarClock = () => Widget.Box({
vpack: 'center',
className: 'spacing-h-4 bar-clock-box',
children: [
Widget.Label({
className: 'bar-time',
label: GLib.DateTime.new_now_local().format(userOptions.time.format),
setup: (self) => self.poll(userOptions.time.interval, label => {
label.label = GLib.DateTime.new_now_local().format(userOptions.time.format);
}),
label: time.bind(),
}),
Widget.Label({
className: 'txt-norm txt-onLayer1',
@@ -45,10 +56,7 @@ const BarClock = () => Widget.Box({
}),
Widget.Label({
className: 'txt-smallie bar-date',
label: GLib.DateTime.new_now_local().format(userOptions.time.dateFormatLong),
setup: (self) => self.poll(userOptions.time.dateInterval, (label) => {
label.label = GLib.DateTime.new_now_local().format(userOptions.time.dateFormatLong);
}),
label: date.bind(),
}),
],
});
+3 -3
View File
@@ -3,15 +3,15 @@ import SystemTray from 'resource:///com/github/Aylur/ags/service/systemtray.js';
const { Box, Icon, Button, Revealer } = Widget;
const { Gravity } = imports.gi.Gdk;
const SysTrayItem = (item) => Button({
const SysTrayItem = (item) => item.id !== null ? Button({
className: 'bar-systray-item',
child: Icon({hpack: 'center'}).bind('icon', item, 'icon'),
child: Icon({ hpack: 'center' }).bind('icon', item, 'icon'),
setup: (self) => self
.hook(item, (self) => self.tooltipMarkup = item['tooltip-markup'])
,
onPrimaryClick: (_, event) => item.activate(event),
onSecondaryClick: (btn, event) => item.menu.popup_at_widget(btn, Gravity.SOUTH, Gravity.NORTH, null),
});
}) : null;
export const Tray = (props = {}) => {
const trayContent = Box({