forked from Shinonome/dots-hyprland
tray: filter out empty tray items (#717)
This commit is contained in:
@@ -3,15 +3,15 @@ import SystemTray from 'resource:///com/github/Aylur/ags/service/systemtray.js';
|
|||||||
const { Box, Icon, Button, Revealer } = Widget;
|
const { Box, Icon, Button, Revealer } = Widget;
|
||||||
const { Gravity } = imports.gi.Gdk;
|
const { Gravity } = imports.gi.Gdk;
|
||||||
|
|
||||||
const SysTrayItem = (item) => Button({
|
const SysTrayItem = (item) => item.id !== null ? Button({
|
||||||
className: 'bar-systray-item',
|
className: 'bar-systray-item',
|
||||||
child: Icon({hpack: 'center'}).bind('icon', item, 'icon'),
|
child: Icon({ hpack: 'center' }).bind('icon', item, 'icon'),
|
||||||
setup: (self) => self
|
setup: (self) => self
|
||||||
.hook(item, (self) => self.tooltipMarkup = item['tooltip-markup'])
|
.hook(item, (self) => self.tooltipMarkup = item['tooltip-markup'])
|
||||||
,
|
,
|
||||||
onPrimaryClick: (_, event) => item.activate(event),
|
onPrimaryClick: (_, event) => item.activate(event),
|
||||||
onSecondaryClick: (btn, event) => item.menu.popup_at_widget(btn, Gravity.SOUTH, Gravity.NORTH, null),
|
onSecondaryClick: (btn, event) => item.menu.popup_at_widget(btn, Gravity.SOUTH, Gravity.NORTH, null),
|
||||||
});
|
}) : null;
|
||||||
|
|
||||||
export const Tray = (props = {}) => {
|
export const Tray = (props = {}) => {
|
||||||
const trayContent = Box({
|
const trayContent = Box({
|
||||||
|
|||||||
Reference in New Issue
Block a user