mirror of
https://github.com/xsghetti/HyprCrux.git
synced 2025-07-03 22:00:38 -04:00
updates
This commit is contained in:
parent
1f8cb3c145
commit
610604e80f
253 changed files with 27055 additions and 44 deletions
40
.config/ags/modules/bar/normal/tray.js
Normal file
40
.config/ags/modules/bar/normal/tray.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
import Widget from 'resource:///com/github/Aylur/ags/widget.js';
|
||||
import SystemTray from 'resource:///com/github/Aylur/ags/service/systemtray.js';
|
||||
const { Box, Icon, Button, Revealer } = Widget;
|
||||
const { Gravity } = imports.gi.Gdk;
|
||||
|
||||
const SysTrayItem = (item) => Button({
|
||||
className: 'bar-systray-item',
|
||||
child: Icon({
|
||||
hpack: 'center',
|
||||
icon: item.icon,
|
||||
setup: (self) => self.hook(item, (self) => self.icon = item.icon),
|
||||
}),
|
||||
setup: (self) => self
|
||||
.hook(item, (self) => self.tooltipMarkup = item['tooltip-markup'])
|
||||
,
|
||||
onPrimaryClick: (_, event) => item.activate(event),
|
||||
onSecondaryClick: (btn, event) => item.menu.popup_at_widget(btn, Gravity.SOUTH, Gravity.NORTH, null),
|
||||
});
|
||||
|
||||
export const Tray = (props = {}) => {
|
||||
const trayContent = Box({
|
||||
className: 'margin-right-5 spacing-h-15',
|
||||
setup: (self) => self
|
||||
.hook(SystemTray, (self) => {
|
||||
self.children = SystemTray.items.map(SysTrayItem);
|
||||
self.show_all();
|
||||
})
|
||||
,
|
||||
});
|
||||
const trayRevealer = Widget.Revealer({
|
||||
revealChild: true,
|
||||
transition: 'slide_left',
|
||||
transitionDuration: userOptions.animations.durationLarge,
|
||||
child: trayContent,
|
||||
});
|
||||
return Box({
|
||||
...props,
|
||||
children: [trayRevealer],
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue