diff options
| author | Freya Murphy <freya@freyacat.org> | 2026-01-09 19:53:59 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2026-01-09 19:53:59 -0500 |
| commit | 9c6aea03b58ead9044184724613ea1baa2a3cd35 (patch) | |
| tree | 982e19a91803cc2842a11fecd272800af373fa43 | |
| parent | len :3 (diff) | |
| download | caelestia-shell-9c6aea03b58ead9044184724613ea1baa2a3cd35.tar.gz caelestia-shell-9c6aea03b58ead9044184724613ea1baa2a3cd35.tar.bz2 caelestia-shell-9c6aea03b58ead9044184724613ea1baa2a3cd35.zip | |
remove more things, make lock screen use wallpaper not screenshot
| -rw-r--r-- | modules/background/Background.qml | 8 | ||||
| -rw-r--r-- | modules/background/Wallpaper.qml | 112 | ||||
| -rw-r--r-- | modules/controlcenter/Session.qml | 1 | ||||
| -rw-r--r-- | modules/controlcenter/components/SliderInput.qml | 181 | ||||
| -rw-r--r-- | modules/controlcenter/state/LauncherState.qml | 8 | ||||
| -rw-r--r-- | modules/lock/LockSurface.qml | 7 | ||||
| -rw-r--r-- | utils/Images.qml | 12 |
7 files changed, 11 insertions, 318 deletions
diff --git a/modules/background/Background.qml b/modules/background/Background.qml index 1bb7d17..f7c0a3f 100644 --- a/modules/background/Background.qml +++ b/modules/background/Background.qml @@ -4,6 +4,7 @@ import qs.components import qs.components.containers import qs.services import qs.config +import qs.utils import Quickshell import Quickshell.Wayland import QtQuick @@ -31,8 +32,13 @@ Loader { anchors.left: true anchors.right: true - Wallpaper { + Image { id: wallpaper + + anchors.fill: parent + asynchronous: true + + source: Paths.wallpaper ?? "" } } } diff --git a/modules/background/Wallpaper.qml b/modules/background/Wallpaper.qml deleted file mode 100644 index 46f7a52..0000000 --- a/modules/background/Wallpaper.qml +++ /dev/null @@ -1,112 +0,0 @@ -pragma ComponentBehavior: Bound - -import qs.components -import qs.components.images -import qs.components.filedialog -import qs.services -import qs.config -import qs.utils -import QtQuick - -Item { - id: root - - property string source: Paths.wallpaper - property Image current: one - - anchors.fill: parent - - onSourceChanged: { - if (!source) - current = null; - else if (current === one) - two.update(); - else - one.update(); - } - - Component.onCompleted: { - if (source) - Qt.callLater(() => one.update()); - } - - Loader { - anchors.fill: parent - - active: !root.source - asynchronous: true - - sourceComponent: StyledRect { - color: Colours.palette.m3surfaceContainer - - Row { - anchors.centerIn: parent - spacing: Appearance.spacing.large - - MaterialIcon { - text: "sentiment_stressed" - color: Colours.palette.m3onSurfaceVariant - font.pointSize: Appearance.font.size.extraLarge * 5 - } - - Column { - anchors.verticalCenter: parent.verticalCenter - spacing: Appearance.spacing.small - - StyledText { - text: qsTr("Wallpaper missing?") - color: Colours.palette.m3onSurfaceVariant - font.pointSize: Appearance.font.size.extraLarge * 2 - font.bold: true - } - } - } - } - } - - Img { - id: one - } - - Img { - id: two - } - - component Img: CachingImage { - id: img - - function update(): void { - if (path === root.source) - root.current = this; - else - path = root.source; - } - - anchors.fill: parent - - opacity: 0 - scale: 0.8 - - onStatusChanged: { - if (status === Image.Ready) - root.current = this; - } - - states: State { - name: "visible" - when: root.current === img - - PropertyChanges { - img.opacity: 1 - img.scale: 1 - } - } - - transitions: Transition { - Anim { - target: img - properties: "opacity,scale" - } - } - } -} diff --git a/modules/controlcenter/Session.qml b/modules/controlcenter/Session.qml index 0408a1a..090ae9b 100644 --- a/modules/controlcenter/Session.qml +++ b/modules/controlcenter/Session.qml @@ -14,7 +14,6 @@ QtObject { readonly property BluetoothState bt: BluetoothState {} readonly property NetworkState network: NetworkState {} readonly property EthernetState ethernet: EthernetState {} - readonly property LauncherState launcher: LauncherState {} onActiveChanged: activeIndex = panes.indexOf(active) onActiveIndexChanged: active = panes[activeIndex] diff --git a/modules/controlcenter/components/SliderInput.qml b/modules/controlcenter/components/SliderInput.qml deleted file mode 100644 index 7348368..0000000 --- a/modules/controlcenter/components/SliderInput.qml +++ /dev/null @@ -1,181 +0,0 @@ -pragma ComponentBehavior: Bound - -import qs.components -import qs.components.controls -import qs.components.effects -import qs.services -import qs.config -import QtQuick -import QtQuick.Layouts - -ColumnLayout { - id: root - - property string label: "" - property real value: 0 - property real from: 0 - property real to: 100 - property real stepSize: 0 - property var validator: null - property string suffix: "" // Optional suffix text (e.g., "×", "px") - property int decimals: 1 // Number of decimal places to show (default: 1) - property var formatValueFunction: null // Optional custom format function - property var parseValueFunction: null // Optional custom parse function - - function formatValue(val: real): string { - if (formatValueFunction) { - return formatValueFunction(val); - } - // Default format function - // Check if it's an IntValidator (IntValidator doesn't have a 'decimals' property) - if (validator && validator.bottom !== undefined && validator.decimals === undefined) { - return Math.round(val).toString(); - } - // For DoubleValidator or no validator, use the decimals property - return val.toFixed(root.decimals); - } - - function parseValue(text: string): real { - if (parseValueFunction) { - return parseValueFunction(text); - } - // Default parse function - if (validator && validator.bottom !== undefined) { - // Check if it's an integer validator - if (validator.top !== undefined && validator.top === Math.floor(validator.top)) { - return parseInt(text); - } - } - return parseFloat(text); - } - - signal valueModified(real newValue) - - property bool _initialized: false - - spacing: Appearance.spacing.small - - Component.onCompleted: { - // Set initialized flag after a brief delay to allow component to fully load - Qt.callLater(() => { - _initialized = true; - }); - } - - RowLayout { - Layout.fillWidth: true - spacing: Appearance.spacing.normal - - StyledText { - visible: root.label !== "" - text: root.label - font.pointSize: Appearance.font.size.normal - } - - Item { - Layout.fillWidth: true - } - - StyledInputField { - id: inputField - Layout.preferredWidth: 70 - validator: root.validator - - Component.onCompleted: { - // Initialize text without triggering valueModified signal - text = root.formatValue(root.value); - } - - onTextEdited: (text) => { - if (hasFocus) { - const val = root.parseValue(text); - if (!isNaN(val)) { - // Validate against validator bounds if available - let isValid = true; - if (root.validator) { - if (root.validator.bottom !== undefined && val < root.validator.bottom) { - isValid = false; - } - if (root.validator.top !== undefined && val > root.validator.top) { - isValid = false; - } - } - - if (isValid) { - root.valueModified(val); - } - } - } - } - - onEditingFinished: { - const val = root.parseValue(text); - let isValid = true; - if (root.validator) { - if (root.validator.bottom !== undefined && val < root.validator.bottom) { - isValid = false; - } - if (root.validator.top !== undefined && val > root.validator.top) { - isValid = false; - } - } - - if (isNaN(val) || !isValid) { - text = root.formatValue(root.value); - } - } - } - - StyledText { - visible: root.suffix !== "" - text: root.suffix - color: Colours.palette.m3outline - font.pointSize: Appearance.font.size.normal - } - } - - StyledSlider { - id: slider - - Layout.fillWidth: true - implicitHeight: Appearance.padding.normal * 3 - - from: root.from - to: root.to - stepSize: root.stepSize - - // Use Binding to allow slider to move freely during dragging - Binding { - target: slider - property: "value" - value: root.value - when: !slider.pressed - } - - onValueChanged: { - // Update input field text in real-time as slider moves during dragging - // Always update when slider value changes (during dragging or external updates) - if (!inputField.hasFocus) { - const newValue = root.stepSize > 0 ? Math.round(value / root.stepSize) * root.stepSize : value; - inputField.text = root.formatValue(newValue); - } - } - - onMoved: { - const newValue = root.stepSize > 0 ? Math.round(value / root.stepSize) * root.stepSize : value; - root.valueModified(newValue); - if (!inputField.hasFocus) { - inputField.text = root.formatValue(newValue); - } - } - } - - // Update input field when value changes externally (slider is already bound) - onValueChanged: { - // Only update if component is initialized to avoid issues during creation - if (root._initialized && !inputField.hasFocus) { - inputField.text = root.formatValue(root.value); - } - } -} - diff --git a/modules/controlcenter/state/LauncherState.qml b/modules/controlcenter/state/LauncherState.qml deleted file mode 100644 index c5da7aa..0000000 --- a/modules/controlcenter/state/LauncherState.qml +++ /dev/null @@ -1,8 +0,0 @@ -import QtQuick - -QtObject { - id: root - - property var active: null -} - diff --git a/modules/lock/LockSurface.qml b/modules/lock/LockSurface.qml index a05e689..be41147 100644 --- a/modules/lock/LockSurface.qml +++ b/modules/lock/LockSurface.qml @@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound import qs.components import qs.services import qs.config +import qs.utils import Quickshell.Wayland import QtQuick import QtQuick.Effects @@ -159,12 +160,12 @@ WlSessionLockSurface { } } - ScreencopyView { + Image { id: background anchors.fill: parent - captureSource: root.screen - opacity: 0 + source: Paths.wallpaper ?? "" + opacity: 1 layer.enabled: true layer.effect: MultiEffect { diff --git a/utils/Images.qml b/utils/Images.qml deleted file mode 100644 index ac76f51..0000000 --- a/utils/Images.qml +++ /dev/null @@ -1,12 +0,0 @@ -pragma Singleton - -import Quickshell - -Singleton { - readonly property list<string> validImageTypes: ["jpeg", "png", "webp", "tiff", "svg"] - readonly property list<string> validImageExtensions: ["jpg", "jpeg", "png", "webp", "tif", "tiff", "svg"] - - function isValidImageByName(name: string): bool { - return validImageExtensions.some(t => name.endsWith(`.${t}`)); - } -} |