summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorFaiz Khan <faizm55212@gmail.com>2025-08-27 10:57:49 +0530
committerGitHub <noreply@github.com>2025-08-27 15:27:49 +1000
commitcdfc260f39e72b821e1d808c7b1536f07b8b6b0a (patch)
treee81152912b112f8c11ddf2241ff3b89479e61214 /modules
parentnix: fix CAELESTIA_LIB_DIR (diff)
downloadcaelestia-shell-cdfc260f39e72b821e1d808c7b1536f07b8b6b0a.tar.gz
caelestia-shell-cdfc260f39e72b821e1d808c7b1536f07b8b6b0a.tar.bz2
caelestia-shell-cdfc260f39e72b821e1d808c7b1536f07b8b6b0a.zip
config: allow enable/disable osd brightness (#481)
* Added option to disable brightness slider * Removed unwanted imports * Renamed WrappedLoader.name to brightnessSlider * fixes --------- Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Diffstat (limited to 'modules')
-rw-r--r--modules/osd/Content.qml46
1 files changed, 29 insertions, 17 deletions
diff --git a/modules/osd/Content.qml b/modules/osd/Content.qml
index 09a4ca6..80fc714 100644
--- a/modules/osd/Content.qml
+++ b/modules/osd/Content.qml
@@ -1,3 +1,5 @@
+pragma ComponentBehavior: Bound
+
import qs.components.controls
import qs.services
import qs.config
@@ -16,6 +18,7 @@ Column {
spacing: Appearance.spacing.normal
+ // Speaker volume
CustomMouseArea {
implicitWidth: Config.osd.sizes.sliderWidth
implicitHeight: Config.osd.sizes.sliderHeight
@@ -36,26 +39,35 @@ Column {
}
}
- CustomMouseArea {
- implicitWidth: Config.osd.sizes.sliderWidth
- implicitHeight: Config.osd.sizes.sliderHeight
+ // Brightness
+ WrappedLoader {
+ active: Config.osd.enableBrightness
- onWheel: event => {
- const monitor = root.monitor;
- if (!monitor)
- return;
- if (event.angleDelta.y > 0)
- monitor.setBrightness(monitor.brightness + 0.1);
- else if (event.angleDelta.y < 0)
- monitor.setBrightness(monitor.brightness - 0.1);
- }
+ sourceComponent: CustomMouseArea {
+ implicitWidth: Config.osd.sizes.sliderWidth
+ implicitHeight: Config.osd.sizes.sliderHeight
- FilledSlider {
- anchors.fill: parent
+ onWheel: event => {
+ const monitor = root.monitor;
+ if (!monitor)
+ return;
+ if (event.angleDelta.y > 0)
+ monitor.setBrightness(monitor.brightness + 0.1);
+ else if (event.angleDelta.y < 0)
+ monitor.setBrightness(monitor.brightness - 0.1);
+ }
+
+ FilledSlider {
+ anchors.fill: parent
- icon: `brightness_${(Math.round(value * 6) + 1)}`
- value: root.monitor?.brightness ?? 0
- onMoved: root.monitor?.setBrightness(value)
+ icon: `brightness_${(Math.round(value * 6) + 1)}`
+ value: root.monitor?.brightness ?? 0
+ onMoved: root.monitor?.setBrightness(value)
+ }
}
}
+ component WrappedLoader: Loader {
+ asynchronous: true
+ visible: active
+ }
}