From cd45cafa601f313f447931002c1351a658aab404 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sun, 4 May 2025 23:18:11 +1000 Subject: bar: add scroll actions to fillers Also change the brightness osd icon depending on value --- modules/bar/Panel.qml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'modules/bar/Panel.qml') diff --git a/modules/bar/Panel.qml b/modules/bar/Panel.qml index 901c766..a43b0c2 100644 --- a/modules/bar/Panel.qml +++ b/modules/bar/Panel.qml @@ -2,12 +2,15 @@ import "root:/widgets" import "root:/config" import "components" import "components/workspaces" +import Quickshell import QtQuick import QtQuick.Layouts StyledRect { id: root + required property ShellScreen screen + function get(horiz, vert) { return BarConfig.vertical ? vert : horiz; } @@ -47,9 +50,29 @@ StyledRect { } } - Item { + MouseArea { Layout.fillWidth: true Layout.fillHeight: true + + onWheel: event => { + if (event.angleDelta.y > 0) + Audio.setVolume(Audio.volume + 0.1); + else if (event.angleDelta.y < 0) + Audio.setVolume(Audio.volume - 0.1); + } + } + + MouseArea { + Layout.fillWidth: true + Layout.fillHeight: true + + onWheel: event => { + const monitor = Brightness.getMonitorForScreen(root.screen); + if (event.angleDelta.y > 0) + monitor.setBrightness(monitor.brightness + 0.1); + else if (event.angleDelta.y < 0) + monitor.setBrightness(monitor.brightness - 0.1); + } } Module { -- cgit v1.2.3-freya