ags: sync

This commit is contained in:
end-4
2023-12-29 13:30:25 +07:00
parent 0832ba6b61
commit 2d238efd10
24 changed files with 586 additions and 180 deletions
+9 -4
View File
@@ -10,7 +10,13 @@ const SysTrayItem = item => Button({
className: 'bar-systray-item',
child: Icon({
hpack: 'center',
binds: [['icon', item, 'icon']]
binds: [['icon', item, 'icon']],
setup: (self) => Utils.timeout(1, () => {
const styleContext = self.get_parent().get_style_context();
const width = styleContext.get_property('min-width', Gtk.StateFlags.NORMAL);
const height = styleContext.get_property('min-height', Gtk.StateFlags.NORMAL);
self.size = Math.max(width, height, 1); // im too lazy to add another box lol
}),
}),
binds: [['tooltipMarkup', item, 'tooltip-markup']],
onClicked: btn => item.menu.popup_at_widget(btn, Gravity.SOUTH, Gravity.NORTH, null),
@@ -19,8 +25,7 @@ const SysTrayItem = item => Button({
export const Tray = (props = {}) => {
const trayContent = Box({
vpack: 'center',
className: 'bar-systray bar-group',
className: 'bar-systray bar-group spacing-h-10',
properties: [
['items', new Map()],
['onAdded', (box, id) => {
@@ -31,7 +36,7 @@ export const Tray = (props = {}) => {
return;
const widget = SysTrayItem(item);
box._items.set(id, widget);
box.pack_start(widget, false, false, 0);
box.add(widget);
box.show_all();
if (box._items.size === 1)
trayRevealer.revealChild = true;