diff --git a/config/ags/js/bar/main.js b/config/ags/js/bar/main.js index a365002..535694a 100644 --- a/config/ags/js/bar/main.js +++ b/config/ags/js/bar/main.js @@ -41,8 +41,6 @@ export const Bar = Window({ SysTray, - Separator(12), - AudioIndicator, Separator(12), diff --git a/config/ags/js/bar/systray.js b/config/ags/js/bar/systray.js index b3d63f3..62bd94c 100644 --- a/config/ags/js/bar/systray.js +++ b/config/ags/js/bar/systray.js @@ -1,8 +1,8 @@ const { SystemTray } = ags.Service; -const { Box, Button, Icon, MenuItem } = ags.Widget; +const { Box, Revealer, Icon, MenuItem } = ags.Widget; const { Gtk } = imports.gi; -import { EventBox } from '../misc/cursorbox.js'; +import { Separator } from '../misc/separator.js'; const SysTrayItem = item => MenuItem({ className: 'tray-item', @@ -16,31 +16,42 @@ const SysTrayItem = item => MenuItem({ }]] }); -export const SysTray = ags.Widget({ - type: Gtk.MenuBar, - className: 'sys-tray', - properties: [ - ['items', new Map()], - ['onAdded', (box, id) => { - const item = SystemTray.getItem(id); - if (box._items.has(id) || !item) - return; +export const SysTray = Revealer({ + transition: 'slide_right', + connections: [[SystemTray, rev => { + rev.revealChild = rev.child.children[0].get_children().length > 0; + }]], + child: Box({ + children: [ + ags.Widget({ + type: Gtk.MenuBar, + className: 'sys-tray', + properties: [ + ['items', new Map()], + ['onAdded', (box, id) => { + const item = SystemTray.getItem(id); + if (box._items.has(id) || !item) + return; - const widget = SysTrayItem(item); - box._items.set(id, widget); - box.add(widget); - box.show_all(); - }], - ['onRemoved', (box, id) => { - if (!box._items.has(id)) - return; + const widget = SysTrayItem(item); + box._items.set(id, widget); + box.add(widget); + box.show_all(); + }], + ['onRemoved', (box, id) => { + if (!box._items.has(id)) + return; - box._items.get(id).destroy(); - box._items.delete(id); - }], - ], - connections: [ - [SystemTray, (box, id) => box._onAdded(box, id), 'added'], - [SystemTray, (box, id) => box._onRemoved(box, id), 'removed'], - ], + box._items.get(id).destroy(); + box._items.delete(id); + }], + ], + connections: [ + [SystemTray, (box, id) => box._onAdded(box, id), 'added'], + [SystemTray, (box, id) => box._onRemoved(box, id), 'removed'], + ], + }), + Separator(12), + ], + }), });