diff options
Diffstat (limited to 'modules/drawers')
| -rw-r--r-- | modules/drawers/Interactions.qml | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/modules/drawers/Interactions.qml b/modules/drawers/Interactions.qml index 1cd1736..6b276a0 100644 --- a/modules/drawers/Interactions.qml +++ b/modules/drawers/Interactions.qml @@ -1,3 +1,4 @@ +import qs.components.controls import qs.services import qs.config import qs.modules.bar.popouts as BarPopouts @@ -5,7 +6,7 @@ import qs.modules.osd as Osd import Quickshell import QtQuick -MouseArea { +CustomMouseArea { id: root required property ShellScreen screen @@ -42,6 +43,23 @@ MouseArea { return y > root.height - Config.border.thickness - panel.height - Config.border.rounding && withinPanelWidth(panel, x, y); } + function onWheel(event: WheelEvent): void { + if (event.x < bar.implicitWidth) { + if (event.y < screen.height / 2) { + if (event.angleDelta.y > 0) + Audio.incrementVolume(); + else if (event.angleDelta.y < 0) + Audio.decrementVolume(); + } else { + const monitor = Brightness.getMonitorForScreen(screen); + if (event.angleDelta.y > 0) + monitor.setBrightness(monitor.brightness + 0.1); + else if (event.angleDelta.y < 0) + monitor.setBrightness(monitor.brightness - 0.1); + } + } + } + anchors.fill: parent hoverEnabled: true |