summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-12 17:15:55 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-12 17:15:55 +1000
commitd06d8b870f8cd2cc15d891412a5129bfc6117e09 (patch)
treec80d9a7bbdccf7a58ee7ab1e91d010224f60168a
parentdashboard: persist state (diff)
downloadcaelestia-shell-d06d8b870f8cd2cc15d891412a5129bfc6117e09.tar.gz
caelestia-shell-d06d8b870f8cd2cc15d891412a5129bfc6117e09.tar.bz2
caelestia-shell-d06d8b870f8cd2cc15d891412a5129bfc6117e09.zip
osd: loader content
-rw-r--r--components/controls/FilledSlider.qml10
-rw-r--r--modules/osd/Content.qml3
-rw-r--r--modules/osd/Wrapper.qml15
3 files changed, 19 insertions, 9 deletions
diff --git a/components/controls/FilledSlider.qml b/components/controls/FilledSlider.qml
index 4ddbfda..f095a7d 100644
--- a/components/controls/FilledSlider.qml
+++ b/components/controls/FilledSlider.qml
@@ -10,6 +10,7 @@ Slider {
required property string icon
property real oldValue
+ property bool initialized
orientation: Qt.Vertical
@@ -32,7 +33,7 @@ Slider {
handle: Item {
id: handle
- property bool moving
+ property alias moving: icon.moving
y: root.visualPosition * (root.availableHeight - height)
implicitWidth: root.width
@@ -64,7 +65,7 @@ Slider {
MaterialIcon {
id: icon
- property bool moving: handle.moving
+ property bool moving
function update(): void {
animate = !moving;
@@ -73,7 +74,6 @@ Slider {
font.family = moving ? Appearance.font.family.sans : Appearance.font.family.material;
}
- animate: true
text: root.icon
color: Colours.palette.m3inverseOnSurface
anchors.centerIn: parent
@@ -108,6 +108,10 @@ Slider {
onPressedChanged: handle.moving = pressed
onValueChanged: {
+ if (!initialized) {
+ initialized = true;
+ return;
+ }
if (Math.abs(value - oldValue) < 0.01)
return;
oldValue = value;
diff --git a/modules/osd/Content.qml b/modules/osd/Content.qml
index 6870a57..f2bb51c 100644
--- a/modules/osd/Content.qml
+++ b/modules/osd/Content.qml
@@ -14,9 +14,6 @@ Item {
required property Brightness.Monitor monitor
required property var visibilities
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
-
implicitWidth: layout.implicitWidth + Appearance.padding.large * 2
implicitHeight: layout.implicitHeight + Appearance.padding.large * 2
diff --git a/modules/osd/Wrapper.qml b/modules/osd/Wrapper.qml
index 62d8c4f..d4fae76 100644
--- a/modules/osd/Wrapper.qml
+++ b/modules/osd/Wrapper.qml
@@ -1,3 +1,5 @@
+pragma ComponentBehavior: Bound
+
import qs.components
import qs.services
import qs.config
@@ -46,10 +48,17 @@ Item {
}
]
- Content {
+ Loader {
id: content
- monitor: Brightness.getMonitorForScreen(root.screen)
- visibilities: root.visibilities
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+
+ Component.onCompleted: active = Qt.binding(() => (root.visibilities.osd && Config.osd.enabled) || root.visible)
+
+ sourceComponent: Content {
+ monitor: Brightness.getMonitorForScreen(root.screen)
+ visibilities: root.visibilities
+ }
}
}