summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-07-02 17:09:49 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-07-02 17:09:49 +1000
commitd7802f3c4b594af54817808bf02bb0bacc106868 (patch)
tree134565d02cf2d2978dcb7bac68774e3ecbb8d092
parentinternal: better curve for button ripples (diff)
downloadcaelestia-shell-d7802f3c4b594af54817808bf02bb0bacc106868.tar.gz
caelestia-shell-d7802f3c4b594af54817808bf02bb0bacc106868.tar.bz2
caelestia-shell-d7802f3c4b594af54817808bf02bb0bacc106868.zip
internal: use layer.effect
Also use clipping rect for wallpaper item
-rw-r--r--modules/areapicker/Picker.qml24
-rw-r--r--modules/drawers/Border.qml25
-rw-r--r--modules/drawers/Drawers.qml17
-rw-r--r--modules/launcher/WallpaperItem.qml53
-rw-r--r--modules/lock/Backgrounds.qml22
-rw-r--r--modules/lock/LockSurface.qml43
-rw-r--r--modules/lock/Notification.qml17
-rw-r--r--modules/notifications/Notification.qml17
8 files changed, 86 insertions, 132 deletions
diff --git a/modules/areapicker/Picker.qml b/modules/areapicker/Picker.qml
index 4a0c537..ce9f743 100644
--- a/modules/areapicker/Picker.qml
+++ b/modules/areapicker/Picker.qml
@@ -184,11 +184,18 @@ MouseArea {
}
StyledRect {
- id: background
-
anchors.fill: parent
color: Colours.palette.m3secondaryContainer
- visible: false
+ opacity: 0.3
+
+ layer.enabled: true
+ layer.effect: MultiEffect {
+ maskSource: selectionWrapper
+ maskEnabled: true
+ maskInverted: true
+ maskSpreadAtMin: 1
+ maskThresholdMin: 0.5
+ }
}
Item {
@@ -209,17 +216,6 @@ MouseArea {
}
}
- MultiEffect {
- anchors.fill: parent
- source: background
- maskSource: selectionWrapper
- maskEnabled: true
- maskInverted: true
- maskSpreadAtMin: 1
- maskThresholdMin: 0.5
- opacity: 0.3
- }
-
Rectangle {
color: "transparent"
radius: root.realRounding > 0 ? root.realRounding + root.realBorderWidth : 0
diff --git a/modules/drawers/Border.qml b/modules/drawers/Border.qml
index 3dada1f..bcb6cd6 100644
--- a/modules/drawers/Border.qml
+++ b/modules/drawers/Border.qml
@@ -1,7 +1,8 @@
+pragma ComponentBehavior: Bound
+
import "root:/widgets"
import "root:/services"
import "root:/config"
-import Quickshell
import QtQuick
import QtQuick.Effects
@@ -13,11 +14,17 @@ Item {
anchors.fill: parent
StyledRect {
- id: rect
-
anchors.fill: parent
color: Colours.alpha(Colours.palette.m3surface, false)
- visible: false
+
+ layer.enabled: true
+ layer.effect: MultiEffect {
+ maskSource: mask
+ maskEnabled: true
+ maskInverted: true
+ maskThresholdMin: 0.5
+ maskSpreadAtMin: 1
+ }
}
Item {
@@ -34,14 +41,4 @@ Item {
radius: Config.border.rounding
}
}
-
- MultiEffect {
- anchors.fill: parent
- maskEnabled: true
- maskInverted: true
- maskSource: mask
- source: rect
- maskThresholdMin: 0.5
- maskSpreadAtMin: 1
- }
}
diff --git a/modules/drawers/Drawers.qml b/modules/drawers/Drawers.qml
index 5cab75b..10cd86b 100644
--- a/modules/drawers/Drawers.qml
+++ b/modules/drawers/Drawers.qml
@@ -86,10 +86,13 @@ Variants {
}
Item {
- id: background
-
anchors.fill: parent
- visible: false
+ layer.enabled: true
+ layer.effect: MultiEffect {
+ shadowEnabled: true
+ blurMax: 15
+ shadowColor: Qt.alpha(Colours.palette.m3shadow, 0.7)
+ }
Border {
bar: bar
@@ -101,14 +104,6 @@ Variants {
}
}
- MultiEffect {
- anchors.fill: source
- source: background
- shadowEnabled: true
- blurMax: 15
- shadowColor: Qt.alpha(Colours.palette.m3shadow, 0.7)
- }
-
PersistentProperties {
id: visibilities
diff --git a/modules/launcher/WallpaperItem.qml b/modules/launcher/WallpaperItem.qml
index 862e910..43c01a9 100644
--- a/modules/launcher/WallpaperItem.qml
+++ b/modules/launcher/WallpaperItem.qml
@@ -2,6 +2,7 @@ import "root:/widgets"
import "root:/services"
import "root:/config"
import Quickshell
+import Quickshell.Widgets
import QtQuick
import QtQuick.Effects
@@ -32,34 +33,10 @@ StyledRect {
}
}
- CachingImage {
- id: image
-
- anchors.horizontalCenter: parent.horizontalCenter
- y: Appearance.padding.large
-
- visible: false
- path: root.modelData.path
- smooth: !root.PathView.view.moving
-
- width: Config.launcher.sizes.wallpaperWidth
- height: width / 16 * 9
- }
-
- Rectangle {
- id: mask
-
- layer.enabled: true
- layer.smooth: true
- visible: false
- anchors.fill: image
- radius: Appearance.rounding.normal
- }
-
RectangularShadow {
opacity: root.PathView.isCurrentItem ? 0.7 : 0
- anchors.fill: mask
- radius: mask.radius
+ anchors.fill: image
+ radius: image.radius
color: Colours.palette.m3shadow
blur: 10
spread: 3
@@ -69,13 +46,23 @@ StyledRect {
}
}
- MultiEffect {
- anchors.fill: image
- source: image
- maskEnabled: true
- maskSource: mask
- maskSpreadAtMin: 1
- maskThresholdMin: 0.5
+ ClippingRectangle {
+ id: image
+
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: Appearance.padding.large
+ color: "transparent"
+ radius: Appearance.rounding.normal
+
+ implicitWidth: Config.launcher.sizes.wallpaperWidth
+ implicitHeight: implicitWidth / 16 * 9
+
+ CachingImage {
+ path: root.modelData.path
+ smooth: !root.PathView.view.moving
+
+ anchors.fill: parent
+ }
}
StyledText {
diff --git a/modules/lock/Backgrounds.qml b/modules/lock/Backgrounds.qml
index c8c5db0..2041b99 100644
--- a/modules/lock/Backgrounds.qml
+++ b/modules/lock/Backgrounds.qml
@@ -1,3 +1,5 @@
+pragma ComponentBehavior: Bound
+
import "root:/widgets"
import "root:/services"
import "root:/config"
@@ -36,7 +38,15 @@ Item {
anchors.fill: parent
color: Colours.alpha(Colours.palette.m3surface, false)
- visible: false
+
+ layer.enabled: true
+ layer.effect: MultiEffect {
+ maskEnabled: true
+ maskInverted: true
+ maskSource: mask
+ maskThresholdMin: 0.5
+ maskSpreadAtMin: 1
+ }
}
Item {
@@ -59,16 +69,6 @@ Item {
}
}
- MultiEffect {
- anchors.fill: parent
- source: base
- maskEnabled: true
- maskInverted: true
- maskSource: mask
- maskThresholdMin: 0.5
- maskSpreadAtMin: 1
- }
-
Shape {
anchors.fill: parent
anchors.margins: Math.floor(innerMask.anchors.margins)
diff --git a/modules/lock/LockSurface.qml b/modules/lock/LockSurface.qml
index 83fb89f..0ad4c3a 100644
--- a/modules/lock/LockSurface.qml
+++ b/modules/lock/LockSurface.qml
@@ -40,30 +40,25 @@ WlSessionLockSurface {
}
ScreencopyView {
- id: screencopy
-
- anchors.fill: parent
- captureSource: root.screen
- visible: false
- }
-
- MultiEffect {
id: background
anchors.fill: parent
+ captureSource: root.screen
- source: screencopy
- autoPaddingEnabled: false
- blurEnabled: true
- blur: root.locked ? 1 : 0
- blurMax: 64
- blurMultiplier: 1
+ layer.enabled: true
+ layer.effect: MultiEffect {
+ autoPaddingEnabled: false
+ blurEnabled: true
+ blur: root.locked ? 1 : 0
+ blurMax: 64
+ blurMultiplier: 1
- Behavior on opacity {
- Anim {}
+ Behavior on blur {
+ Anim {}
+ }
}
- Behavior on blur {
+ Behavior on opacity {
Anim {}
}
}
@@ -79,15 +74,13 @@ WlSessionLockSurface {
statusHeight: status.item?.nonAnimHeight ?? 0
isNormal: root.screen.width > Config.lock.sizes.smallScreenWidth
isLarge: root.screen.width > Config.lock.sizes.largeScreenWidth
- visible: false
- }
- MultiEffect {
- anchors.fill: source
- source: backgrounds
- shadowEnabled: true
- blurMax: 15
- shadowColor: Qt.alpha(Colours.palette.m3shadow, 0.7)
+ layer.enabled: true
+ layer.effect: MultiEffect {
+ shadowEnabled: true
+ blurMax: 15
+ shadowColor: Qt.alpha(Colours.palette.m3shadow, 0.7)
+ }
}
Clock {
diff --git a/modules/lock/Notification.qml b/modules/lock/Notification.qml
index 936edd4..a2f23f6 100644
--- a/modules/lock/Notification.qml
+++ b/modules/lock/Notification.qml
@@ -123,26 +123,19 @@ StyledRect {
asynchronous: true
anchors.centerIn: parent
- visible: !root.modelData.appIcon.endsWith("symbolic")
width: Math.round(parent.width * 0.6)
height: Math.round(parent.width * 0.6)
sourceComponent: IconImage {
- implicitSize: Math.round(parent.width * 0.6)
+ anchors.fill: parent
source: Quickshell.iconPath(root.modelData.appIcon)
asynchronous: true
- }
- }
-
- Loader {
- active: root.modelData.appIcon.endsWith("symbolic")
- asynchronous: true
- anchors.fill: icon
- sourceComponent: Colouriser {
- source: icon
- colorizationColor: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3onError : root.modelData.urgency === NotificationUrgency.Low ? Colours.palette.m3onSurface : Colours.palette.m3onTertiaryContainer
+ layer.enabled: root.modelData.appIcon.endsWith("symbolic")
+ layer.effect: Colouriser {
+ colorizationColor: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3onError : root.modelData.urgency === NotificationUrgency.Low ? Colours.palette.m3onSurface : Colours.palette.m3onTertiaryContainer
+ }
}
}
diff --git a/modules/notifications/Notification.qml b/modules/notifications/Notification.qml
index c97a332..1a520c8 100644
--- a/modules/notifications/Notification.qml
+++ b/modules/notifications/Notification.qml
@@ -151,26 +151,19 @@ StyledRect {
asynchronous: true
anchors.centerIn: parent
- visible: !root.modelData.appIcon.endsWith("symbolic")
width: Math.round(parent.width * 0.6)
height: Math.round(parent.width * 0.6)
sourceComponent: IconImage {
- implicitSize: Math.round(parent.width * 0.6)
+ anchors.fill: parent
source: Quickshell.iconPath(root.modelData.appIcon)
asynchronous: true
- }
- }
-
- Loader {
- active: root.modelData.appIcon.endsWith("symbolic")
- asynchronous: true
- anchors.fill: icon
- sourceComponent: Colouriser {
- source: icon
- colorizationColor: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3onError : root.modelData.urgency === NotificationUrgency.Low ? Colours.palette.m3onSurface : Colours.palette.m3onTertiaryContainer
+ layer.enabled: root.modelData.appIcon.endsWith("symbolic")
+ layer.effect: Colouriser {
+ colorizationColor: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3onError : root.modelData.urgency === NotificationUrgency.Low ? Colours.palette.m3onSurface : Colours.palette.m3onTertiaryContainer
+ }
}
}