diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-04 23:18:11 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-04 23:18:11 +1000 |
| commit | cd45cafa601f313f447931002c1351a658aab404 (patch) | |
| tree | 789d8ab9271e4b7e2d39a628e1efdb3da2c9ecf9 | |
| parent | osd: pause hide on hover (diff) | |
| download | caelestia-shell-cd45cafa601f313f447931002c1351a658aab404.tar.gz caelestia-shell-cd45cafa601f313f447931002c1351a658aab404.tar.bz2 caelestia-shell-cd45cafa601f313f447931002c1351a658aab404.zip | |
bar: add scroll actions to fillers
Also change the brightness osd icon depending on value
| -rw-r--r-- | modules/bar/Bar.qml | 8 | ||||
| -rw-r--r-- | modules/bar/Panel.qml | 25 | ||||
| -rw-r--r-- | modules/bar/Pills.qml | 23 | ||||
| -rw-r--r-- | modules/osd/Content.qml | 2 | ||||
| -rw-r--r-- | modules/osd/Osd.qml | 1 |
5 files changed, 52 insertions, 7 deletions
diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index 37d2617..658ef87 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -45,12 +45,16 @@ Variants { Preset { presetName: "pills" - sourceComponent: Pills {} + sourceComponent: Pills { + screen: win.modelData + } } Preset { presetName: "panel" - sourceComponent: Panel {} + sourceComponent: Panel { + screen: win.modelData + } } } diff --git a/modules/bar/Panel.qml b/modules/bar/Panel.qml index 901c766..a43b0c2 100644 --- a/modules/bar/Panel.qml +++ b/modules/bar/Panel.qml @@ -2,12 +2,15 @@ import "root:/widgets" import "root:/config" import "components" import "components/workspaces" +import Quickshell import QtQuick import QtQuick.Layouts StyledRect { id: root + required property ShellScreen screen + function get(horiz, vert) { return BarConfig.vertical ? vert : horiz; } @@ -47,9 +50,29 @@ StyledRect { } } - Item { + MouseArea { Layout.fillWidth: true Layout.fillHeight: true + + 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 { + Layout.fillWidth: true + Layout.fillHeight: true + + onWheel: event => { + const monitor = Brightness.getMonitorForScreen(root.screen); + if (event.angleDelta.y > 0) + monitor.setBrightness(monitor.brightness + 0.1); + else if (event.angleDelta.y < 0) + monitor.setBrightness(monitor.brightness - 0.1); + } } Module { diff --git a/modules/bar/Pills.qml b/modules/bar/Pills.qml index b6b9288..e326827 100644 --- a/modules/bar/Pills.qml +++ b/modules/bar/Pills.qml @@ -1,13 +1,17 @@ import "root:/widgets" +import "root:/services" import "root:/config" import "components" import "components/workspaces" +import Quickshell import QtQuick import QtQuick.Layouts BoxLayout { id: root + required property ShellScreen screen + function get(horiz, vert) { return BarConfig.vertical ? vert : horiz; } @@ -42,9 +46,16 @@ BoxLayout { } } - Item { + MouseArea { Layout.fillWidth: true Layout.fillHeight: true + + 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); + } } Pill { @@ -56,9 +67,17 @@ BoxLayout { } } - Item { + MouseArea { Layout.fillWidth: true Layout.fillHeight: true + + onWheel: event => { + const monitor = Brightness.getMonitorForScreen(root.screen); + if (event.angleDelta.y > 0) + monitor.setBrightness(monitor.brightness + 0.1); + else if (event.angleDelta.y < 0) + monitor.setBrightness(monitor.brightness - 0.1); + } } Pill { diff --git a/modules/osd/Content.qml b/modules/osd/Content.qml index b224bf6..54976e4 100644 --- a/modules/osd/Content.qml +++ b/modules/osd/Content.qml @@ -34,7 +34,7 @@ Column { } VerticalSlider { - icon: "brightness_6" + icon: `brightness_${(Math.round(value * 6) + 1)}` value: root.monitor?.brightness ?? 0 onMoved: root.monitor?.setBrightness(value) diff --git a/modules/osd/Osd.qml b/modules/osd/Osd.qml index 33a12ab..3f6d8bc 100644 --- a/modules/osd/Osd.qml +++ b/modules/osd/Osd.qml @@ -99,7 +99,6 @@ Variants { HoverHandler { id: hoverHandler - parent: win onHoveredChanged: { root.hovered = hovered; if (hovered) |