diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-02 21:09:19 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-02 21:09:19 +1000 |
| commit | 05d8a6a7cbe26b589f5a33602d8cffff59d18180 (patch) | |
| tree | 3f04fbc2fb583bb39c5b5d3d133ab6452e0d2355 /modules/bar/components | |
| parent | feat: bar popouts (diff) | |
| download | caelestia-shell-05d8a6a7cbe26b589f5a33602d8cffff59d18180.tar.gz caelestia-shell-05d8a6a7cbe26b589f5a33602d8cffff59d18180.tar.bz2 caelestia-shell-05d8a6a7cbe26b589f5a33602d8cffff59d18180.zip | |
bar: fix scroll areas
Diffstat (limited to 'modules/bar/components')
| -rw-r--r-- | modules/bar/components/ActiveWindow.qml | 30 |
1 files changed, 30 insertions, 0 deletions
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 |