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';
|
import Separator from '../misc/separator.js';
|
||||||
|
|
||||||
|
|
||||||
const SysTrayItem = item => MenuItem({
|
const SysTrayItem = item => {
|
||||||
|
if (item.id === 'spotify-client')
|
||||||
|
return;
|
||||||
|
|
||||||
|
return MenuItem({
|
||||||
child: Revealer({
|
child: Revealer({
|
||||||
transition: 'slide_right',
|
transition: 'slide_right',
|
||||||
child: Icon({
|
child: Icon({
|
||||||
|
@ -20,6 +24,7 @@ const SysTrayItem = item => MenuItem({
|
||||||
btn.tooltipMarkup = item.tooltipMarkup;
|
btn.tooltipMarkup = item.tooltipMarkup;
|
||||||
}]],
|
}]],
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const SysTray = () => {
|
const SysTray = () => {
|
||||||
const widget = Gtk.MenuBar.new();
|
const widget = Gtk.MenuBar.new();
|
||||||
|
@ -33,6 +38,10 @@ const SysTray = () => {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const w = SysTrayItem(item);
|
const w = SysTrayItem(item);
|
||||||
|
// Early return if item is in blocklist
|
||||||
|
if (!w)
|
||||||
|
return;
|
||||||
|
|
||||||
widget._items.set(id, w);
|
widget._items.set(id, w);
|
||||||
widget.add(w);
|
widget.add(w);
|
||||||
widget.show_all();
|
widget.show_all();
|
||||||
|
|
Loading…
Reference in a new issue