better click area for right side of the bar

This commit is contained in:
end-4
2024-03-16 11:28:39 +07:00
parent 123d962cfb
commit fa641efc1d
+18 -15
View File
@@ -38,17 +38,7 @@ export default () => {
} }
}), }),
}); });
const actualContent = Widget.Box({ const SpaceRightDefaultClicks = (child) => Widget.EventBox({
hexpand: true,
className: 'spacing-h-5 txt',
children: [
Widget.Box({
hexpand: true,
className: 'spacing-h-5 txt',
children: [
Widget.Box({ hexpand: true, }),
barTray,
Widget.EventBox({
onScrollUp: () => { onScrollUp: () => {
if (!Audio.speaker) return; if (!Audio.speaker) return;
if (Audio.speaker.volume <= 0.09) Audio.speaker.volume += 0.01; if (Audio.speaker.volume <= 0.09) Audio.speaker.volume += 0.01;
@@ -70,13 +60,26 @@ export default () => {
if (event.get_button()[1] === 8) if (event.get_button()[1] === 8)
execAsync('playerctl previous').catch(print) execAsync('playerctl previous').catch(print)
}), }),
child: Widget.Box({ child: child,
});
const emptyArea = SpaceRightDefaultClicks(Widget.Box({ hexpand: true, })),
const indicatorArea = SpaceRightDefaultClicks(Widget.Box({
children: [ children: [
separatorDot, separatorDot,
barStatusIcons, barStatusIcons
], ],
}), }));
}), const actualContent = Widget.Box({
hexpand: true,
className: 'spacing-h-5 txt',
children: [
Widget.Box({
hexpand: true,
className: 'spacing-h-5 txt',
children: [
emptyArea,
barTray,
indicatorArea
], ],
}), }),
] ]