From 05d8a6a7cbe26b589f5a33602d8cffff59d18180 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Mon, 2 Jun 2025 21:09:19 +1000 Subject: bar: fix scroll areas --- modules/bar/components/ActiveWindow.qml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'modules/bar/components/ActiveWindow.qml') diff --git a/modules/bar/components/ActiveWindow.qml b/modules/bar/components/ActiveWindow.qml index 6f387f4..f6204ae 100644 --- a/modules/bar/components/ActiveWindow.qml +++ b/modules/bar/components/ActiveWindow.qml @@ -9,12 +9,42 @@ import QtQuick Item { id: root + required property Brightness.Monitor monitor property color colour: Colours.palette.m3primary readonly property Item child: child implicitWidth: child.implicitWidth implicitHeight: child.implicitHeight + MouseArea { + anchors.top: parent.top + anchors.bottom: child.top + anchors.left: parent.left + anchors.right: parent.right + + 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 { + anchors.top: child.bottom + anchors.bottom: parent.bottom + anchors.left: parent.left + anchors.right: parent.right + + onWheel: event => { + const monitor = root.monitor; + if (event.angleDelta.y > 0) + monitor.setBrightness(monitor.brightness + 0.1); + else if (event.angleDelta.y < 0) + monitor.setBrightness(monitor.brightness - 0.1); + } + } + Item { id: child -- cgit v1.2.3-freya