fix: reduce shader usage and fix greeter

This commit is contained in:
2026-10-24 00:35:24 +02:00
parent cbd4e6caa7
commit e35c87b3f2
56 changed files with 819 additions and 638 deletions
-49
View File
@@ -1,49 +0,0 @@
pragma ComponentBehavior: Bound
import Quickshell
import QtQuick
import QtQuick.Effects
import ZShell.Config
import qs.Components
import qs.Services
Item {
id: root
required property Item bar
required property ScreenState screenState
anchors.fill: parent
CustomRect {
anchors.fill: parent
anchors.margins: -1
color: Colors.palette.m3surface
layer.enabled: true
layer.effect: MultiEffect {
maskEnabled: true
maskInverted: true
maskSource: mask
maskSpreadAtMin: 1
maskThresholdMin: 0.5
}
}
Item {
id: mask
anchors.fill: parent
layer.enabled: true
visible: false
Rectangle {
anchors.fill: parent
anchors.margins: Config.bar.border + 1
anchors.topMargin: root.bar.implicitHeight + 1
radius: Config.bar.border > 0 ? Config.bar.rounding : 0
topLeftRadius: Config.bar.rounding
topRightRadius: Config.bar.rounding
}
}
}
+2 -2
View File
@@ -134,7 +134,7 @@ Item {
node: Audio.source
}
CustomClippingRect {
ClipRect {
anchors.fill: parent
radius: parent.radius
@@ -249,7 +249,7 @@ Item {
node: appBox.modelData
}
CustomClippingRect {
ClipRect {
anchors.fill: parent
radius: parent.radius
+3 -3
View File
@@ -25,7 +25,7 @@ Item {
searchField.forceActiveFocus();
}
CustomClippingRect {
ClipRect {
id: search
anchors.left: parent.left
@@ -54,7 +54,7 @@ Item {
}
}
CustomClippingRect {
ClipRect {
id: preview
anchors.bottom: parent.bottom
@@ -228,7 +228,7 @@ Item {
anchors.fill: parent
spacing: Tokens.spacing.small
CustomClippingRect {
ClipRect {
id: textRect
Layout.fillHeight: true
+1 -1
View File
@@ -14,7 +14,7 @@ Row {
padding: 20
spacing: 12
CustomClippingRect {
ClipRect {
color: Colors.layer(Colors.palette.m3surfaceContainerHigh, 2)
implicitHeight: info.implicitHeight
implicitWidth: info.implicitHeight
+1 -1
View File
@@ -16,7 +16,7 @@ Item {
implicitWidth: 1000
implicitHeight: 320
CustomClippingRect {
ClipRect {
anchors.fill: parent
radius: root.radius
@@ -46,7 +46,7 @@ CustomListView {
anchors.bottom: parent.bottom
spacing: Tokens.spacing.extraSmall / 2
CustomClippingRect {
ClipRect {
id: iconClip
Layout.fillHeight: true
@@ -25,7 +25,7 @@ Item {
onClicked: root.close()
}
CustomClippingRect {
ClipRect {
id: popupBackground
readonly property real padding: 4
@@ -40,7 +40,7 @@ Item {
visible: false
z: 999
CustomClippingRect {
ClipRect {
id: popupBackground
readonly property real padding: Tokens.padding.extraSmall
+1 -1
View File
@@ -19,7 +19,7 @@ Item {
implicitHeight: tileHeight + Tokens.padding.large * 2
implicitWidth: tileWidth
CustomClippingRect {
ClipRect {
id: image
anchors.horizontalCenter: parent.horizontalCenter
+1 -1
View File
@@ -55,7 +55,7 @@ ColumnLayout {
text: Time.format("dddd, d MMMM yyyy")
}
CustomClippingRect {
ClipRect {
Layout.alignment: Qt.AlignHCenter
Layout.topMargin: Tokens.spacing.largeIncreased * 2
color: Colors.tPalette.m3surfaceContainer
+1 -1
View File
@@ -5,7 +5,7 @@ import qs.Helpers
import ZShell.Config
import qs.Services
CustomClippingRect {
ClipRect {
id: root
required property var lock
+2 -2
View File
@@ -2,12 +2,12 @@ import QtQuick
import QtQuick.Layouts
import Quickshell
import ZShell.Components
import qs.Components
import ZShell.Config
import qs.Components
import qs.Helpers
import qs.Services
CustomClippingRect {
ClipRect {
id: root
required property var lock
+2 -3
View File
@@ -24,12 +24,11 @@ ColumnLayout {
Layout.fillWidth: true
color: Colors.palette.m3outline
elide: Text.ElideRight
font.family: Config.appearance.font.family.mono
font.weight: 500
font: Tokens.font.mono.builders.small.weight(Font.Medium).build()
text: NotifServer.list.length > 0 ? qsTr("%1 notification%2").arg(NotifServer.list.length).arg(NotifServer.list.length === 1 ? "" : "s") : qsTr("Notifications")
}
ClippingRectangle {
ClipRect {
id: clipRect
Layout.fillHeight: true
+1 -1
View File
@@ -85,7 +85,7 @@ CustomRect {
}
}
ClippingRectangle {
ClipRect {
anchors.fill: parent
color: root.urgency === "critical" ? Colors.palette.m3error : root.urgency === "low" ? Colors.layer(Colors.palette.m3surfaceContainerHighest, 3) : Colors.palette.m3secondaryContainer
radius: Tokens.rounding.full
+2 -1
View File
@@ -1,12 +1,13 @@
import Quickshell
import Quickshell.Widgets
import QtQuick
import qs.Components
import qs.Paths
Item {
id: root
ClippingRectangle {
ClipRect {
anchors.fill: parent
radius: Tokens.rounding.full
+1 -1
View File
@@ -108,7 +108,7 @@ CustomRect {
visible: root.hasImage || root.hasAppIcon
width: Config.notifs.sizes.image
sourceComponent: CustomClippingRect {
sourceComponent: ClipRect {
color: root.modelData.urgency === NotificationUrgency.Critical ? Colors.palette.m3error : root.modelData.urgency === NotificationUrgency.Low ? Colors.layer(Colors.palette.m3surfaceContainerHighest, 2) : Colors.palette.m3secondaryContainer
implicitHeight: Config.notifs.sizes.image
implicitWidth: Config.notifs.sizes.image
+1 -1
View File
@@ -5,7 +5,7 @@ import ZShell.Config
import qs.Components
import qs.Services
CustomClippingRect {
ClipRect {
id: root
property real animPerc: UPower.displayDevice.percentage
+1 -1
View File
@@ -19,7 +19,7 @@ CustomRect {
implicitWidth: 450
radius: Tokens.rounding.largeIncreased
CustomClippingRect {
ClipRect {
anchors.fill: parent
radius: parent.radius
+1 -1
View File
@@ -149,7 +149,7 @@ ColumnLayout {
}
}
Flickable {
CustomFlickable {
id: flickable
Layout.fillHeight: true
+1 -1
View File
@@ -25,7 +25,7 @@ Item {
anchors.fill: parent
spacing: Tokens.spacing.small
CustomClippingRect {
ClipRect {
id: imgWrapper
Layout.fillWidth: true
+30 -28
View File
@@ -100,16 +100,13 @@ Item {
visible: opacity > 0
Behavior on opacity {
Anim {
}
Anim {}
}
Behavior on scale {
Anim {
}
Anim {}
}
Behavior on y {
Anim {
}
Anim {}
}
Component.onCompleted: {
@@ -120,9 +117,8 @@ Item {
Qt.callLater(syncCropToScreen);
}
ButtonRow {
id: screenSelector
Loader {
id: selectorLoader
anchors.bottom: imageSlot.top
anchors.bottomMargin: Tokens.spacing.medium
anchors.left: parent.left
@@ -130,25 +126,32 @@ Item {
anchors.right: parent.right
anchors.rightMargin: Tokens.padding.extraLarge * 2
anchors.top: parent.top
spacing: Tokens.spacing.small
Repeater {
model: wrapper.screens
active: wrapper.screens.length > 1
delegate: TextButton {
required property int index
readonly property bool isCurrent: wrapper.selectedScreenIndex === index
required property var modelData
sourceComponent: ButtonRow {
id: screenSelector
fillWidth: true
font: Tokens.font.body.builders.large.weight(Font.DemiBold).build()
inactiveColor: isCurrent ? Colors.palette.m3primary : Qt.alpha(Colors.palette.m3surfaceContainer, 0.7)
inactiveOnColor: isCurrent ? Colors.palette.m3onPrimary : Qt.alpha(Colors.palette.m3onSurface, 0.7)
isRound: true
shapeMorph: true
text: modelData.name
spacing: Tokens.spacing.small
onClicked: wrapper.selectScreen(index)
Repeater {
model: wrapper.screens
delegate: TextButton {
required property int index
readonly property bool isCurrent: wrapper.selectedScreenIndex === index
required property var modelData
fillWidth: true
font: Tokens.font.body.builders.large.weight(Font.DemiBold).build()
inactiveColor: isCurrent ? Colors.palette.m3primary : Qt.alpha(Colors.palette.m3surfaceContainer, 0.7)
inactiveOnColor: isCurrent ? Colors.palette.m3onPrimary : Qt.alpha(Colors.palette.m3onSurface, 0.7)
isRound: true
shapeMorph: true
text: modelData.name
onClicked: wrapper.selectScreen(index)
}
}
}
}
@@ -222,9 +225,9 @@ Item {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.topMargin: wrapper.buttonRowHeight + Tokens.spacing.medium
anchors.topMargin: selectorLoader.active ? wrapper.buttonRowHeight + Tokens.spacing.medium : Tokens.spacing.medium
CustomClippingRect {
ClipRect {
id: fitBox
readonly property real aspect: scaledImg.implicitHeight > 0 ? scaledImg.implicitWidth / scaledImg.implicitHeight : 1
@@ -357,8 +360,7 @@ Item {
width: Math.round(baseWidth / zoom)
Behavior on color {
CAnim {
}
CAnim {}
}
Component.onCompleted: {
+2
View File
@@ -38,6 +38,7 @@ Item {
}
BlobInvertedRect {
id: blobRect
anchors.fill: parent
borderBottom: Tokens.padding.small
borderLeft: navPane.width + navPane.anchors.margins * 2
@@ -65,6 +66,7 @@ Item {
anchors.bottom: parent.bottom
anchors.left: navPane.right
anchors.leftMargin: navPane.anchors.margins + anchors.margins
anchors.bottomMargin: blobRect.borderBottom
anchors.margins: Tokens.padding.extraLarge
anchors.right: parent.right
anchors.top: parent.top
+1 -1
View File
@@ -436,7 +436,7 @@ Item {
width: attachments.cellWidth
height: width
opacity: modelData ? 1 : 0
CustomClippingRect {
ClipRect {
anchors.fill: parent
anchors.margins: Tokens.spacing.extraSmall
@@ -337,7 +337,7 @@ Item {
}
}
CustomClippingRect {
ClipRect {
id: expandedTool
anchors.top: collapsedRow.bottom
@@ -252,7 +252,7 @@ CustomRect {
}
}
CustomClippingRect {
CustomRect {
id: codeRect
anchors.left: parent.left
@@ -265,6 +265,7 @@ CustomRect {
implicitWidth: codeText.implicitWidth + codeFlick.anchors.margins * 2
implicitHeight: codeText.implicitHeight + codeFlick.anchors.margins * 2
color: CodeColors.active.bg
clip: true
Flickable {
id: codeFlick
@@ -272,6 +273,9 @@ CustomRect {
anchors.fill: parent
anchors.margins: Tokens.padding.small
boundsBehavior: Flickable.StopAtBounds
contentWidth: codeText.implicitWidth
CustomScrollBar.horizontal: CustomScrollBar {
flickable: codeFlick
parent: codeFlick.parent
@@ -280,16 +284,13 @@ CustomRect {
anchors.right: parent.right
}
TextAreaBase.flickable: TextAreaBase {
CustomText {
id: codeText
color: CodeColors.active.normal
layer.enabled: true
clip: false
font: Tokens.font.mono.small
textFormat: root.colored ? Text.RichText : Text.PlainText
textFormat: Text.RichText
text: root.colored ? root.html : root.plainForDisplay(root.code)
readOnly: true
}
}
}
@@ -125,7 +125,7 @@ Item {
current: root.current
}
CustomClippingRect {
ClipRect {
id: expandedRect
anchors.left: parent.left
+1 -1
View File
@@ -86,7 +86,7 @@ Item {
}
}
CustomClippingRect {
ClipRect {
anchors.fill: parent
anchors.leftMargin: invertedRect.borderLeft
anchors.topMargin: invertedRect.borderTop
-70
View File
@@ -17,76 +17,6 @@ Item {
Layout.fillWidth: true
implicitHeight: flickable.contentHeight
layer.enabled: true
layer.smooth: true
layer.effect: Mask {
maskSource: gradientMask
}
Item {
id: gradientMask
anchors.fill: parent
layer.enabled: true
visible: false
Rectangle {
anchors.fill: parent
gradient: Gradient {
orientation: Gradient.Horizontal
GradientStop {
color: Qt.rgba(0, 0, 0, 0)
position: 0
}
GradientStop {
color: Qt.rgba(0, 0, 0, 1)
position: 0.1
}
GradientStop {
color: Qt.rgba(0, 0, 0, 1)
position: 0.9
}
GradientStop {
color: Qt.rgba(0, 0, 0, 0)
position: 1
}
}
}
Rectangle {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.top: parent.top
implicitWidth: parent.width / 2
opacity: flickable.contentX > 0 ? 0 : 1
Behavior on opacity {
Anim {
type: Anim.DefaultEffects
}
}
}
Rectangle {
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.top: parent.top
implicitWidth: parent.width / 2
opacity: flickable.contentX < flickable.contentWidth - parent.width ? 0 : 1
Behavior on opacity {
Anim {
type: Anim.DefaultEffects
}
}
}
}
CustomFlickable {
id: flickable
+1 -1
View File
@@ -112,7 +112,7 @@ CustomRect {
}
}
CustomClippingRect {
ClipRect {
anchors.fill: parent
color: root.urgency === NotificationUrgency.Critical ? Colors.palette.m3error : root.urgency === NotificationUrgency.Low ? Colors.layer(Colors.palette.m3surfaceContainerHigh, 3) : Colors.palette.m3secondaryContainer
radius: Tokens.rounding.full