mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-03 10:14:45 +00:00
Switch DropShadow for RectangularGlow on lockscreen to improve performance
DropShadow requires actually sampling and blurring the source element, while RectangularGlow just creates a generic rectangle without caring about the source element. This greatly improves the speed of everything on the lockscreen, especially notifications (they aren't a laggy mess when you have a ton of them now)
This commit is contained in:
parent
f1ab00cb3c
commit
3f985548e8
2 changed files with 31 additions and 34 deletions
|
|
@ -133,6 +133,16 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RectangularGlow {
|
||||||
|
anchors.topMargin: 1
|
||||||
|
anchors.fill: topTextDisplay
|
||||||
|
cached: true
|
||||||
|
glowRadius: 4
|
||||||
|
spread: 0.2
|
||||||
|
color: keypadRoot.dropShadowColor
|
||||||
|
opacity: (Math.sin(2*((Math.PI / 2) * keypadRoot.swipeProgress + 1.5 * Math.PI)) + 1)
|
||||||
|
}
|
||||||
|
|
||||||
// rectangle "bar" on the top of the keypad
|
// rectangle "bar" on the top of the keypad
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: topTextDisplay
|
id: topTextDisplay
|
||||||
|
|
@ -144,18 +154,6 @@ Rectangle {
|
||||||
opacity: (Math.sin(2*((Math.PI / 2) * keypadRoot.swipeProgress + 1.5 * Math.PI)) + 1)
|
opacity: (Math.sin(2*((Math.PI / 2) * keypadRoot.swipeProgress + 1.5 * Math.PI)) + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
DropShadow {
|
|
||||||
anchors.fill: topTextDisplay
|
|
||||||
source: topTextDisplay
|
|
||||||
cached: true
|
|
||||||
horizontalOffset: 0
|
|
||||||
verticalOffset: 1
|
|
||||||
radius: 4
|
|
||||||
samples: 6
|
|
||||||
color: keypadRoot.dropShadowColor
|
|
||||||
opacity: (Math.sin(2*((Math.PI / 2) * keypadRoot.swipeProgress + 1.5 * Math.PI)) + 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
// pin dot display
|
// pin dot display
|
||||||
Item {
|
Item {
|
||||||
anchors.verticalCenter: topTextDisplay.verticalCenter
|
anchors.verticalCenter: topTextDisplay.verticalCenter
|
||||||
|
|
@ -227,6 +225,17 @@ Rectangle {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
|
RectangularGlow {
|
||||||
|
anchors.topMargin: 1
|
||||||
|
anchors.fill: keyRect
|
||||||
|
cornerRadius: keyRect.radius * 2
|
||||||
|
cached: true
|
||||||
|
glowRadius: 2
|
||||||
|
spread: 0.2
|
||||||
|
color: keypadRoot.dropShadowColor
|
||||||
|
opacity: (Math.sin(2*((Math.PI / 2) * keypadRoot.swipeProgress + 1.5 * Math.PI)) + 1)
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: keyRect
|
id: keyRect
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
@ -265,18 +274,6 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DropShadow {
|
|
||||||
anchors.fill: keyRect
|
|
||||||
source: keyRect
|
|
||||||
cached: true
|
|
||||||
horizontalOffset: 0
|
|
||||||
verticalOffset: 1
|
|
||||||
radius: 4
|
|
||||||
samples: 6
|
|
||||||
color: keypadRoot.dropShadowColor
|
|
||||||
opacity: (Math.sin(2*((Math.PI / 2) * keypadRoot.swipeProgress + 1.5 * Math.PI)) + 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.Label {
|
PlasmaComponents.Label {
|
||||||
visible: modelData !== "R" && modelData !== "E"
|
visible: modelData !== "R" && modelData !== "E"
|
||||||
text: modelData
|
text: modelData
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,16 @@ Item {
|
||||||
|
|
||||||
opacity: 1 - Math.min(1, 1.5 * Math.abs(rect.x) / width) // opacity during dismiss swipe
|
opacity: 1 - Math.min(1, 1.5 * Math.abs(rect.x) / width) // opacity during dismiss swipe
|
||||||
|
|
||||||
|
RectangularGlow {
|
||||||
|
anchors.topMargin: 1
|
||||||
|
anchors.leftMargin: 1
|
||||||
|
anchors.fill: rect
|
||||||
|
cornerRadius: rect.radius * 2
|
||||||
|
glowRadius: 2
|
||||||
|
spread: 0.2
|
||||||
|
color: "#616161"
|
||||||
|
}
|
||||||
|
|
||||||
// notification
|
// notification
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: rect
|
id: rect
|
||||||
|
|
@ -202,14 +212,4 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DropShadow {
|
|
||||||
anchors.fill: rect
|
|
||||||
source: rect
|
|
||||||
horizontalOffset: 1
|
|
||||||
verticalOffset: 1
|
|
||||||
radius: 4
|
|
||||||
samples: 6
|
|
||||||
color: "#616161"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue