diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2025-09-10 15:57:26 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2025-09-10 15:57:26 +0200 |
| commit | d20393e077b8d97b18f4a224ddcb20caf6dac23b (patch) | |
| tree | 337a8630deecdb50a2c879754e6b34b71575bbe0 /accounts/gkleen@sif/shell/quickshell/BrightnessWidget.qml | |
| parent | 9fab3828698199718a3d2f2faf8826f77d9258f7 (diff) | |
| download | nixos-d20393e077b8d97b18f4a224ddcb20caf6dac23b.tar nixos-d20393e077b8d97b18f4a224ddcb20caf6dac23b.tar.gz nixos-d20393e077b8d97b18f4a224ddcb20caf6dac23b.tar.bz2 nixos-d20393e077b8d97b18f4a224ddcb20caf6dac23b.tar.xz nixos-d20393e077b8d97b18f4a224ddcb20caf6dac23b.zip | |
...
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell/BrightnessWidget.qml')
| -rw-r--r-- | accounts/gkleen@sif/shell/quickshell/BrightnessWidget.qml | 33 |
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 @@ | |||
| 1 | import QtQuick | ||
| 2 | import Quickshell | ||
| 3 | import Quickshell.Widgets | ||
| 4 | import qs.Services | ||
| 5 | |||
| 6 | Item { | ||
| 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 | } | ||
