summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/shell/quickshell/BrightnessWidget.qml
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell/BrightnessWidget.qml')
-rw-r--r--accounts/gkleen@sif/shell/quickshell/BrightnessWidget.qml33
1 files changed, 33 insertions, 0 deletions
diff --git a/accounts/gkleen@sif/shell/quickshell/BrightnessWidget.qml b/accounts/gkleen@sif/shell/quickshell/BrightnessWidget.qml
new file mode 100644
index 00000000..664b28e2
--- /dev/null
+++ b/accounts/gkleen@sif/shell/quickshell/BrightnessWidget.qml
@@ -0,0 +1,33 @@
1import QtQuick
2import Quickshell
3import Quickshell.Widgets
4import qs.Services
5
6Item {
7 height: parent.height
8 width: brightnessIcon.width
9 anchors.verticalCenter: parent.verticalCenter
10
11 WrapperMouseArea {
12 id: widgetMouseArea
13
14 anchors.fill: parent
15
16 property real sensitivity: (1 / 50) / 120
17 onWheel: event => Brightness.currBrightness += event.angleDelta.y * sensitivity
18
19 Item {
20 anchors.fill: parent
21
22 MaterialDesignIcon {
23 id: brightnessIcon
24
25 implicitSize: 14
26 anchors.centerIn: parent
27
28 icon: `brightness-${Math.min(7, Math.floor(Brightness.currBrightness * 7) + 1)}`
29 color: "#555"
30 }
31 }
32 }
33}