diff options
Diffstat (limited to 'modules/background')
| -rw-r--r-- | modules/background/Background.qml | 17 | ||||
| -rw-r--r-- | modules/background/DesktopClock.qml | 19 | ||||
| -rw-r--r-- | modules/background/Visualiser.qml | 151 | ||||
| -rw-r--r-- | modules/background/Wallpaper.qml | 40 |
4 files changed, 2 insertions, 225 deletions
diff --git a/modules/background/Background.qml b/modules/background/Background.qml index fbacfab..1bb7d17 100644 --- a/modules/background/Background.qml +++ b/modules/background/Background.qml @@ -34,23 +34,6 @@ Loader { Wallpaper { id: wallpaper } - - Visualiser { - anchors.fill: parent - screen: win.modelData - wallpaper: wallpaper - } - - Loader { - anchors.right: parent.right - anchors.bottom: parent.bottom - anchors.margins: Appearance.padding.large - - active: Config.background.desktopClock.enabled - asynchronous: true - - source: "DesktopClock.qml" - } } } } diff --git a/modules/background/DesktopClock.qml b/modules/background/DesktopClock.qml deleted file mode 100644 index 2de325c..0000000 --- a/modules/background/DesktopClock.qml +++ /dev/null @@ -1,19 +0,0 @@ -import qs.components -import qs.services -import qs.config -import QtQuick - -Item { - implicitWidth: timeText.implicitWidth + Appearance.padding.large * 2 - implicitHeight: timeText.implicitHeight + Appearance.padding.large * 2 - - StyledText { - id: timeText - - anchors.centerIn: parent - text: Time.format(Config.services.useTwelveHourClock ? "hh:mm:ss A" : "hh:mm:ss") - font.family: Appearance.font.family.clock - font.pointSize: Appearance.font.size.extraLarge - font.bold: true - } -} diff --git a/modules/background/Visualiser.qml b/modules/background/Visualiser.qml deleted file mode 100644 index f6020da..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)) - 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 index 233dacb..46f7a52 100644 --- a/modules/background/Wallpaper.qml +++ b/modules/background/Wallpaper.qml @@ -11,7 +11,7 @@ import QtQuick Item { id: root - property string source: Wallpapers.current + property string source: Paths.wallpaper property Image current: one anchors.fill: parent @@ -59,42 +59,6 @@ Item { font.pointSize: Appearance.font.size.extraLarge * 2 font.bold: true } - - StyledRect { - implicitWidth: selectWallText.implicitWidth + Appearance.padding.large * 2 - implicitHeight: selectWallText.implicitHeight + Appearance.padding.small * 2 - - radius: Appearance.rounding.full - color: Colours.palette.m3primary - - FileDialog { - id: dialog - - title: qsTr("Select a wallpaper") - filterLabel: qsTr("Image files") - filters: Images.validImageExtensions - onAccepted: path => Wallpapers.setWallpaper(path) - } - - StateLayer { - radius: parent.radius - color: Colours.palette.m3onPrimary - - function onClicked(): void { - dialog.open(); - } - } - - StyledText { - id: selectWallText - - anchors.centerIn: parent - - text: qsTr("Set it now!") - color: Colours.palette.m3onPrimary - font.pointSize: Appearance.font.size.large - } - } } } } @@ -121,7 +85,7 @@ Item { anchors.fill: parent opacity: 0 - scale: Wallpapers.showPreview ? 1 : 0.8 + scale: 0.8 onStatusChanged: { if (status === Image.Ready) |