summaryrefslogtreecommitdiff
path: root/modules/background
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2026-01-22 09:02:54 -0500
committerFreya Murphy <freya@freyacat.org>2026-01-22 09:02:54 -0500
commit25039abf05be0f1381fa74eb0a05032b1d636126 (patch)
tree70b4b545756a2535e9bb2230376ff93945aab0df /modules/background
parentremove lockscreen (diff)
downloadcaelestia-shell-25039abf05be0f1381fa74eb0a05032b1d636126.tar.gz
caelestia-shell-25039abf05be0f1381fa74eb0a05032b1d636126.tar.bz2
caelestia-shell-25039abf05be0f1381fa74eb0a05032b1d636126.zip
fix rebase
Diffstat (limited to 'modules/background')
-rw-r--r--modules/background/DesktopClock.qml169
-rw-r--r--modules/background/Visualiser.qml151
-rw-r--r--modules/background/Wallpaper.qml111
3 files changed, 0 insertions, 431 deletions
diff --git a/modules/background/DesktopClock.qml b/modules/background/DesktopClock.qml
deleted file mode 100644
index 77fe447..0000000
--- a/modules/background/DesktopClock.qml
+++ /dev/null
@@ -1,169 +0,0 @@
-pragma ComponentBehavior: Bound
-
-import qs.components
-import qs.services
-import qs.config
-import QtQuick
-import QtQuick.Layouts
-import QtQuick.Effects
-
-Item {
- id: root
-
- required property Item wallpaper
- required property real absX
- required property real absY
-
- property real scale: Config.background.desktopClock.scale
- readonly property bool bgEnabled: Config.background.desktopClock.background.enabled
- readonly property bool blurEnabled: bgEnabled && Config.background.desktopClock.background.blur
- readonly property bool invertColors: Config.background.desktopClock.invertColors
- readonly property bool useLightSet: Colours.light ? !invertColors : invertColors
- readonly property color safePrimary: useLightSet ? Colours.palette.m3primaryContainer : Colours.palette.m3primary
- readonly property color safeSecondary: useLightSet ? Colours.palette.m3secondaryContainer : Colours.palette.m3secondary
- readonly property color safeTertiary: useLightSet ? Colours.palette.m3tertiaryContainer : Colours.palette.m3tertiary
-
- implicitWidth: layout.implicitWidth + (Appearance.padding.large * 4 * root.scale)
- implicitHeight: layout.implicitHeight + (Appearance.padding.large * 2 * root.scale)
-
- Item {
- id: clockContainer
-
- anchors.fill: parent
-
- layer.enabled: Config.background.desktopClock.shadow.enabled
- layer.effect: MultiEffect {
- shadowEnabled: true
- shadowColor: Colours.palette.m3shadow
- shadowOpacity: Config.background.desktopClock.shadow.opacity
- shadowBlur: Config.background.desktopClock.shadow.blur
- }
-
- Loader {
- anchors.fill: parent
- active: root.blurEnabled
-
- sourceComponent: MultiEffect {
- source: ShaderEffectSource {
- sourceItem: root.wallpaper
- sourceRect: Qt.rect(root.absX, root.absY, root.width, root.height)
- }
- maskSource: backgroundPlate
- maskEnabled: true
- blurEnabled: true
- blur: 1
- blurMax: 64
- autoPaddingEnabled: false
- }
- }
-
- StyledRect {
- id: backgroundPlate
-
- visible: root.bgEnabled
- anchors.fill: parent
- radius: Appearance.rounding.large * root.scale
- opacity: Config.background.desktopClock.background.opacity
- color: Colours.palette.m3surface
-
- layer.enabled: root.blurEnabled
- }
-
- RowLayout {
- id: layout
-
- anchors.centerIn: parent
- spacing: Appearance.spacing.larger * root.scale
-
- RowLayout {
- spacing: Appearance.spacing.small
-
- StyledText {
- text: Time.hourStr
- font.pointSize: Appearance.font.size.extraLarge * 3 * root.scale
- font.weight: Font.Bold
- color: root.safePrimary
- }
-
- StyledText {
- text: ":"
- font.pointSize: Appearance.font.size.extraLarge * 3 * root.scale
- color: root.safeTertiary
- opacity: 0.8
- Layout.topMargin: -Appearance.padding.large * 1.5 * root.scale
- }
-
- StyledText {
- text: Time.minuteStr
- font.pointSize: Appearance.font.size.extraLarge * 3 * root.scale
- font.weight: Font.Bold
- color: root.safeSecondary
- }
-
- Loader {
- Layout.alignment: Qt.AlignTop
- Layout.topMargin: Appearance.padding.large * 1.4 * root.scale
-
- active: Config.services.useTwelveHourClock
- visible: active
-
- sourceComponent: StyledText {
- text: Time.amPmStr
- font.pointSize: Appearance.font.size.large * root.scale
- color: root.safeSecondary
- }
- }
- }
-
- StyledRect {
- Layout.fillHeight: true
- Layout.preferredWidth: 4 * root.scale
- Layout.topMargin: Appearance.spacing.larger * root.scale
- Layout.bottomMargin: Appearance.spacing.larger * root.scale
- radius: Appearance.rounding.full
- color: root.safePrimary
- opacity: 0.8
- }
-
- ColumnLayout {
- spacing: 0
-
- StyledText {
- text: Time.format("MMMM").toUpperCase()
- font.pointSize: Appearance.font.size.large * root.scale
- font.letterSpacing: 4
- font.weight: Font.Bold
- color: root.safeSecondary
- }
-
- StyledText {
- text: Time.format("dd")
- font.pointSize: Appearance.font.size.extraLarge * root.scale
- font.letterSpacing: 2
- font.weight: Font.Medium
- color: root.safePrimary
- }
-
- StyledText {
- text: Time.format("dddd")
- font.pointSize: Appearance.font.size.larger * root.scale
- font.letterSpacing: 2
- color: root.safeSecondary
- }
- }
- }
- }
-
- Behavior on scale {
- Anim {
- duration: Appearance.anim.durations.expressiveDefaultSpatial
- easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
- }
- }
-
- Behavior on implicitWidth {
- Anim {
- duration: Appearance.anim.durations.small
- }
- }
-}
diff --git a/modules/background/Visualiser.qml b/modules/background/Visualiser.qml
deleted file mode 100644
index c9bb9ef..0000000
--- a/modules/background/Visualiser.qml
+++ /dev/null
@@ -1,151 +0,0 @@
-pragma ComponentBehavior: Bound
-
-import qs.components
-import qs.services
-import qs.config
-import Caelestia.Services
-import Quickshell
-import Quickshell.Widgets
-import QtQuick
-import QtQuick.Effects
-
-Item {
- id: root
-
- required property ShellScreen screen
- required property Wallpaper wallpaper
-
- readonly property bool shouldBeActive: Config.background.visualiser.enabled && (!Config.background.visualiser.autoHide || (Hypr.monitorFor(screen)?.activeWorkspace?.toplevels?.values.every(t => t.lastIpcObject?.floating) ?? true))
- property real offset: shouldBeActive ? 0 : screen.height * 0.2
-
- opacity: shouldBeActive ? 1 : 0
-
- Loader {
- anchors.fill: parent
- active: root.opacity > 0 && Config.background.visualiser.blur
-
- sourceComponent: MultiEffect {
- source: root.wallpaper
- maskSource: wrapper
- maskEnabled: true
- blurEnabled: true
- blur: 1
- blurMax: 32
- autoPaddingEnabled: false
- }
- }
-
- Item {
- id: wrapper
-
- anchors.fill: parent
- layer.enabled: true
-
- Loader {
- anchors.fill: parent
- anchors.topMargin: root.offset
- anchors.bottomMargin: -root.offset
-
- active: root.opacity > 0
-
- sourceComponent: Item {
- ServiceRef {
- service: Audio.cava
- }
-
- Item {
- id: content
-
- anchors.fill: parent
- anchors.margins: Config.border.thickness
- anchors.leftMargin: Visibilities.bars.get(root.screen).exclusiveZone + Appearance.spacing.small * Config.background.visualiser.spacing
-
- Side {
- content: content
- }
- Side {
- content: content
- isRight: true
- }
-
- Behavior on anchors.leftMargin {
- Anim {}
- }
- }
- }
- }
- }
-
- Behavior on offset {
- Anim {}
- }
-
- Behavior on opacity {
- Anim {}
- }
-
- component Side: Repeater {
- id: side
-
- required property Item content
- property bool isRight
-
- model: Config.services.visualiserBars
-
- ClippingRectangle {
- id: bar
-
- required property int modelData
- property real value: Math.max(0, Math.min(1, Audio.cava.values[side.isRight ? modelData : side.count - modelData - 1]))
-
- clip: true
-
- x: modelData * ((side.content.width * 0.4) / Config.services.visualiserBars) + (side.isRight ? side.content.width * 0.6 : 0)
- implicitWidth: (side.content.width * 0.4) / Config.services.visualiserBars - Appearance.spacing.small * Config.background.visualiser.spacing
-
- y: side.content.height - height
- implicitHeight: bar.value * side.content.height * 0.4
-
- color: "transparent"
- topLeftRadius: Appearance.rounding.small * Config.background.visualiser.rounding
- topRightRadius: Appearance.rounding.small * Config.background.visualiser.rounding
-
- Rectangle {
- topLeftRadius: parent.topLeftRadius
- topRightRadius: parent.topRightRadius
-
- gradient: Gradient {
- orientation: Gradient.Vertical
-
- GradientStop {
- position: 0
- color: Qt.alpha(Colours.palette.m3primary, 0.7)
-
- Behavior on color {
- CAnim {}
- }
- }
- GradientStop {
- position: 1
- color: Qt.alpha(Colours.palette.m3inversePrimary, 0.7)
-
- Behavior on color {
- CAnim {}
- }
- }
- }
-
- anchors.left: parent.left
- anchors.right: parent.right
- y: parent.height - height
- implicitHeight: side.content.height * 0.4
- }
-
- Behavior on value {
- Anim {
- duration: Appearance.anim.durations.small
- }
- }
- }
- }
-}
diff --git a/modules/background/Wallpaper.qml b/modules/background/Wallpaper.qml
deleted file mode 100644
index 9b91530..0000000
--- a/modules/background/Wallpaper.qml
+++ /dev/null
@@ -1,111 +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
-
- 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"
- }
- }
- }
-}