summaryrefslogtreecommitdiff
path: root/modules/bar/components
diff options
context:
space:
mode:
Diffstat (limited to 'modules/bar/components')
-rw-r--r--modules/bar/components/ActiveWindow.qml30
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