Update pika-hyprland-settings/etc/skel/.config/ags/widgets/systray.js
This commit is contained in:
parent
72b0ec3898
commit
c243cbef27
@ -4,26 +4,23 @@ const { Widget } = ags;
|
|||||||
export const Systray = () => Widget.Box({
|
export const Systray = () => Widget.Box({
|
||||||
className: 'systray',
|
className: 'systray',
|
||||||
connections: [[SystemTray, box => {
|
connections: [[SystemTray, box => {
|
||||||
const arr = SystemTray.items;
|
box.children = SystemTray.items.map(item =>{
|
||||||
box.children = arr.map(item =>{
|
const iconW = Widget.Icon({
|
||||||
const icon = SystemTray.get_icon(item, 24);
|
size: 24
|
||||||
if (!icon) {
|
});
|
||||||
return;
|
iconW.set_margin_left(6);
|
||||||
}
|
iconW.icon = item.icon;
|
||||||
icon.set_margin_left(7);
|
|
||||||
const btn = Widget.Button({
|
const btn = Widget.Button({
|
||||||
//call the Activate function when icon is clicked
|
onPrimaryClick: (_, event) => item.activate(event),
|
||||||
//Note: if item.ItemIsMenu is true, left click should open menu
|
onSecondaryClick: (_, event) => item.openMenu(event),
|
||||||
onPrimaryClick: (_, event) => item.ActivateAsync(event.get_root_coords()[1], event.get_root_coords()[2]),
|
child: iconW,
|
||||||
//open menu on right click.
|
|
||||||
//Note: if item.Menu is not set item.ContextMenuAsync(x, y) should be called.
|
|
||||||
onSecondaryClick: (_, event) => {
|
|
||||||
item.AgsMenu.popup_at_widget(btn, 8, 2, event);
|
|
||||||
},
|
|
||||||
//show icon
|
|
||||||
className: 'systray-icon',
|
className: 'systray-icon',
|
||||||
child: icon,
|
connections: [[item, button => {
|
||||||
tooltipMarkup: SystemTray.get_tooltip_markup(item)
|
button.child.icon = item.icon;
|
||||||
} ); return btn;});
|
button.tooltipMarkup = item.tooltipMarkup;
|
||||||
|
}]],
|
||||||
|
});
|
||||||
|
return btn;
|
||||||
|
});
|
||||||
}]],
|
}]],
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user