mirror of
https://github.com/danbulant/dots-hyprland
synced 2026-05-24 12:22:09 +00:00
fix tray (#329)
This commit is contained in:
parent
d1ec61193e
commit
5fc36cdc01
2 changed files with 36 additions and 33 deletions
|
|
@ -48,41 +48,44 @@ export default () => {
|
|||
children: [
|
||||
Widget.Box({ hexpand: true, }),
|
||||
barTray,
|
||||
separatorDot,
|
||||
barStatusIcons,
|
||||
Widget.EventBox({
|
||||
onScrollUp: () => {
|
||||
if (!Audio.speaker) return;
|
||||
if (Audio.speaker.volume <= 0.09) Audio.speaker.volume += 0.01;
|
||||
else Audio.speaker.volume += 0.03;
|
||||
Indicator.popup(1);
|
||||
},
|
||||
onScrollDown: () => {
|
||||
if (!Audio.speaker) return;
|
||||
if (Audio.speaker.volume <= 0.09) Audio.speaker.volume -= 0.01;
|
||||
else Audio.speaker.volume -= 0.03;
|
||||
Indicator.popup(1);
|
||||
},
|
||||
onHover: () => { barStatusIcons.toggleClassName('bar-statusicons-hover', true) },
|
||||
onHoverLost: () => { barStatusIcons.toggleClassName('bar-statusicons-hover', false) },
|
||||
onPrimaryClick: () => App.toggleWindow('sideright'),
|
||||
onSecondaryClick: () => execAsync(['bash', '-c', 'playerctl next || playerctl position `bc <<< "100 * $(playerctl metadata mpris:length) / 1000000 / 100"` &']).catch(print),
|
||||
onMiddleClick: () => execAsync('playerctl play-pause').catch(print),
|
||||
setup: (self) => self.on('button-press-event', (self, event) => {
|
||||
if (event.get_button()[1] === 8)
|
||||
execAsync('playerctl previous').catch(print)
|
||||
}),
|
||||
child: Widget.Box({
|
||||
children: [
|
||||
separatorDot,
|
||||
barStatusIcons,
|
||||
],
|
||||
}),
|
||||
}),
|
||||
],
|
||||
}),
|
||||
]
|
||||
});
|
||||
|
||||
return Widget.EventBox({
|
||||
onScrollUp: () => {
|
||||
if (!Audio.speaker) return;
|
||||
if (Audio.speaker.volume <= 0.09) Audio.speaker.volume += 0.01;
|
||||
else Audio.speaker.volume += 0.03;
|
||||
Indicator.popup(1);
|
||||
},
|
||||
onScrollDown: () => {
|
||||
if (!Audio.speaker) return;
|
||||
if (Audio.speaker.volume <= 0.09) Audio.speaker.volume -= 0.01;
|
||||
else Audio.speaker.volume -= 0.03;
|
||||
Indicator.popup(1);
|
||||
},
|
||||
onHover: () => { barStatusIcons.toggleClassName('bar-statusicons-hover', true) },
|
||||
onHoverLost: () => { barStatusIcons.toggleClassName('bar-statusicons-hover', false) },
|
||||
onPrimaryClick: () => App.toggleWindow('sideright'),
|
||||
onSecondaryClick: () => execAsync(['bash', '-c', 'playerctl next || playerctl position `bc <<< "100 * $(playerctl metadata mpris:length) / 1000000 / 100"` &']).catch(print),
|
||||
onMiddleClick: () => execAsync('playerctl play-pause').catch(print),
|
||||
setup: (self) => self.on('button-press-event', (self, event) => {
|
||||
if (event.get_button()[1] === 8)
|
||||
execAsync('playerctl previous').catch(print)
|
||||
}),
|
||||
child: Widget.Box({
|
||||
homogeneous: false,
|
||||
children: [
|
||||
actualContent,
|
||||
Widget.Box({ className: 'bar-corner-spacing' }),
|
||||
]
|
||||
})
|
||||
return Widget.Box({
|
||||
children: [
|
||||
actualContent,
|
||||
Widget.Box({ className: 'bar-corner-spacing' }),
|
||||
]
|
||||
});
|
||||
}
|
||||
|
|
@ -13,8 +13,8 @@ const SysTrayItem = (item) => Button({
|
|||
setup: (self) => self
|
||||
.hook(item, (self) => self.tooltipMarkup = item['tooltip-markup'])
|
||||
,
|
||||
onClicked: btn => item.menu.popup_at_widget(btn, Gravity.SOUTH, Gravity.NORTH, null),
|
||||
onSecondaryClick: btn => item.menu.popup_at_widget(btn, Gravity.SOUTH, Gravity.NORTH, null),
|
||||
onPrimaryClick: (_, event) => item.activate(event),
|
||||
onSecondaryClick: (btn, event) => item.menu.popup_at_widget(btn, Gravity.SOUTH, Gravity.NORTH, null),
|
||||
});
|
||||
|
||||
export const Tray = (props = {}) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue