feat(ags systray): add way to block systray items
This commit is contained in:
parent
68962df0b8
commit
9e0841fff3
1 changed files with 21 additions and 12 deletions
|
@ -7,19 +7,24 @@ import Gtk from 'gi://Gtk';
|
|||
import Separator from '../misc/separator.js';
|
||||
|
||||
|
||||
const SysTrayItem = item => MenuItem({
|
||||
child: Revealer({
|
||||
transition: 'slide_right',
|
||||
child: Icon({
|
||||
size: 24,
|
||||
const SysTrayItem = item => {
|
||||
if (item.id === 'spotify-client')
|
||||
return;
|
||||
|
||||
return MenuItem({
|
||||
child: Revealer({
|
||||
transition: 'slide_right',
|
||||
child: Icon({
|
||||
size: 24,
|
||||
}),
|
||||
}),
|
||||
}),
|
||||
submenu: item.menu,
|
||||
connections: [[item, btn => {
|
||||
btn.child.child.icon = item.icon;
|
||||
btn.tooltipMarkup = item.tooltipMarkup;
|
||||
}]],
|
||||
});
|
||||
submenu: item.menu,
|
||||
connections: [[item, btn => {
|
||||
btn.child.child.icon = item.icon;
|
||||
btn.tooltipMarkup = item.tooltipMarkup;
|
||||
}]],
|
||||
});
|
||||
};
|
||||
|
||||
const SysTray = () => {
|
||||
const widget = Gtk.MenuBar.new();
|
||||
|
@ -33,6 +38,10 @@ const SysTray = () => {
|
|||
return;
|
||||
|
||||
const w = SysTrayItem(item);
|
||||
// Early return if item is in blocklist
|
||||
if (!w)
|
||||
return;
|
||||
|
||||
widget._items.set(id, w);
|
||||
widget.add(w);
|
||||
widget.show_all();
|
||||
|
|
Loading…
Reference in a new issue