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,7 +7,11 @@ import Gtk from 'gi://Gtk';
|
|||
import Separator from '../misc/separator.js';
|
||||
|
||||
|
||||
const SysTrayItem = item => MenuItem({
|
||||
const SysTrayItem = item => {
|
||||
if (item.id === 'spotify-client')
|
||||
return;
|
||||
|
||||
return MenuItem({
|
||||
child: Revealer({
|
||||
transition: 'slide_right',
|
||||
child: Icon({
|
||||
|
@ -19,7 +23,8 @@ const SysTrayItem = item => MenuItem({
|
|||
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