feat(ags): add anim to systray items appear and destroy
This commit is contained in:
parent
186fed7bfa
commit
aebf9772ee
1 changed files with 13 additions and 5 deletions
|
@ -8,12 +8,15 @@ import { Separator } from '../misc/separator.js';
|
|||
|
||||
const SysTrayItem = item => MenuItem({
|
||||
className: 'tray-item',
|
||||
child: Revealer({
|
||||
transition: 'slide_right',
|
||||
child: Icon({
|
||||
size: 24,
|
||||
}),
|
||||
}),
|
||||
submenu: item.menu,
|
||||
connections: [[item, btn => {
|
||||
btn.child.icon = item.icon;
|
||||
btn.child.child.icon = item.icon;
|
||||
btn.tooltipMarkup = item.tooltipMarkup;
|
||||
}]]
|
||||
});
|
||||
|
@ -39,13 +42,18 @@ export const SysTray = Revealer({
|
|||
box._items.set(id, widget);
|
||||
box.add(widget);
|
||||
box.show_all();
|
||||
widget.child.revealChild = true;
|
||||
}],
|
||||
|
||||
['onRemoved', (box, id) => {
|
||||
if (!box._items.has(id))
|
||||
return;
|
||||
|
||||
box._items.get(id).child.revealChild = false;
|
||||
setTimeout(() => {
|
||||
box._items.get(id).destroy();
|
||||
box._items.delete(id);
|
||||
}, 400);
|
||||
}],
|
||||
],
|
||||
connections: [
|
||||
|
|
Loading…
Reference in a new issue