fix: reduce shader usage

This commit is contained in:
2026-10-23 00:05:08 +02:00
parent 6781078467
commit 36cddc96c3
32 changed files with 959 additions and 84 deletions
+3 -1
View File
@@ -19,7 +19,7 @@ Item {
required property Wrapper popouts
function resolveIcon(app: string, icon: string): string {
if (app === "chrome_status_icon_1") {
if (app === "discord_status_icon_1" && Config.bar.tray.replaceIcons) {
return Quickshell.iconPath("discord-tray");
} else if (app === "AyuGramDesktop") {
if (icon === Quickshell.iconPath("com.ayugram.desktop-attention-symbolic"))
@@ -50,6 +50,8 @@ Item {
radius: Tokens.rounding.full
StateLayer {
id: layer
acceptedButtons: Qt.LeftButton | Qt.RightButton
anchors.fill: parent
color: icon.layer.enabled && root.current ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
+32 -28
View File
@@ -33,8 +33,7 @@ Item {
y: parent.y
Behavior on implicitHeight {
Anim {
}
Anim {}
}
}
@@ -101,8 +100,7 @@ Item {
value: Audio.volume
Behavior on value {
Anim {
}
Anim {}
}
onInteraction: value => Audio.setVolume(value)
@@ -123,7 +121,7 @@ Item {
}
}
CustomClippingRect {
CustomRect {
Layout.fillWidth: true
Layout.preferredHeight: 65 + Tokens.spacing.small * 2
Layout.topMargin: root.topMargin
@@ -136,17 +134,21 @@ Item {
node: Audio.source
}
CustomRect {
id: sourcePeakFill
CustomClippingRect {
anchors.fill: parent
radius: parent.radius
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.top: parent.top
color: Qt.alpha(Colors.palette.m3primary, 0.15)
implicitWidth: parent.width * sourcePeak.peak
CustomRect {
id: sourcePeakFill
Behavior on implicitWidth {
Anim {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.top: parent.top
color: Qt.alpha(Colors.palette.m3primary, 0.15)
implicitWidth: parent.width * sourcePeak.peak
Behavior on implicitWidth {
Anim {}
}
}
}
@@ -195,8 +197,7 @@ Item {
value: Audio.sourceVolume
Behavior on value {
Anim {
}
Anim {}
}
onInteraction: value => Audio.setSourceVolume(value)
@@ -230,7 +231,7 @@ Item {
model: Audio.streams.filter(s => s.isSink)
CustomClippingRect {
CustomRect {
id: appBox
required property int index
@@ -248,17 +249,21 @@ Item {
node: appBox.modelData
}
CustomRect {
id: peakFill
CustomClippingRect {
anchors.fill: parent
radius: parent.radius
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.top: parent.top
color: Qt.alpha(Colors.palette.m3primary, 0.15)
implicitWidth: parent.width * peak.peak
CustomRect {
id: peakFill
Behavior on implicitWidth {
Anim {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.top: parent.top
color: Qt.alpha(Colors.palette.m3primary, 0.15)
implicitWidth: parent.width * peak.peak
Behavior on implicitWidth {
Anim {}
}
}
}
@@ -316,8 +321,7 @@ Item {
value: appBox.modelData.audio.volume
Behavior on value {
Anim {
}
Anim {}
}
onInteraction: value => Audio.setStreamVolume(appBox.modelData, value)
+2 -1
View File
@@ -9,7 +9,7 @@ import qs.Modules
import qs.Helpers
import qs.Services
CustomClippingRect {
CustomRect {
id: root
readonly property bool hasUpdates: Object.keys(Updates.updates)?.length > 0
@@ -73,6 +73,7 @@ CustomClippingRect {
implicitHeight: Math.min(contentHeight, (root.itemHeight + spacing) * 5 - spacing)
implicitWidth: contentWidth
spacing: Tokens.spacing.medium
clip: true
delegate: CustomRect {
id: update
-2
View File
@@ -1,6 +1,4 @@
import Quickshell
import Quickshell.Wayland
import Quickshell.Hyprland
import QtQuick
import qs.Components
import ZShell.Config
+7 -11
View File
@@ -3,8 +3,9 @@ pragma ComponentBehavior: Bound
import Quickshell
import Quickshell.Widgets
import QtQuick
import qs.Components
import ZShell.Config
import ZShell.Components
import qs.Components
import qs.Daemons
import qs.Helpers
@@ -27,7 +28,7 @@ Item {
for (let i = 0; i < count; i++)
height += (list.itemAtIndex(i) as NotifWrapper)?.nonAnimHeight ?? 0;
if (panels.popouts.hasCurrent && (panels.popouts.currentCenter + (panels.popouts.current?.width / 2)) > panels.notifications.x)
if (panels.popouts.hasCurrent && (panels.popouts.currentCenter + (panels.popouts.current?.width / 2)) > panels.notifications.x || screenState.dashboard)
return 0;
if (screenState.osd) {
@@ -36,25 +37,20 @@ Item {
height = h;
}
if (screenState.session) {
const h = panels.session.y - Tokens.spacing.small * 2 - padding * 2;
if (height > h)
height = h;
}
return Math.min(((QsWindow.window as QsWindow)?.screen?.height ?? 0) - 1 * 2, height + padding * 2);
}
implicitWidth: Config.notifs.sizes.width + padding * 2
Behavior on implicitHeight {
Anim {}
}
ClippingWrapperRectangle {
Item {
anchors.fill: parent
anchors.margins: root.padding
color: "transparent"
radius: Tokens.rounding.large - root.padding
clip: true
// radius: Tokens.rounding.large - root.padding
CustomListView {
id: list
@@ -6,7 +6,7 @@ import qs.Effects
import qs.Components
import qs.Services
CustomClippingRect {
CustomRect {
id: root
property bool expanded: false
@@ -185,7 +185,7 @@ Item {
}
}
CustomClippingRect {
CustomRect {
id: fabMenuItem
required property var modelData
@@ -197,6 +197,7 @@ Item {
radius: sLayer.pressed ? Tokens.rounding.small : implicitHeight / 2
color: Colors.palette.m3primaryContainer
visible: !(modelData.name === "pop out in window" && ChatState.isWindow)
clip: true
Behavior on radius {
Anim {
@@ -24,7 +24,7 @@ Item {
implicitHeight: bubble.implicitHeight + (actionsRow.shouldBeActive ? actionsRow.implicitHeight + actionsRow.anchors.topMargin : 0)
CustomClippingRect {
CustomRect {
id: bubble
property real liveTargetWidth: root.isUser ? Math.min(msgText.implicitWidth + Tokens.padding.medium * 2, root.contentMaxWidth) : root.contentMaxWidth
@@ -37,8 +37,7 @@ Item {
implicitWidth: layoutFrozen ? frozenWidth : layoutWidth
implicitHeight: root.isUser ? msgText.contentHeight + Tokens.padding.medium * 2 : markdown.implicitHeight + markdown.anchors.topMargin * 2
anchors.right: root.isUser ? parent.right : undefined
layer.enabled: false
layer.smooth: true
clip: true
transform: Scale {
id: stretchScale
@@ -223,12 +223,13 @@ MouseArea {
height: width
opacity: modelData ? 1 : 0
CustomClippingRect {
CustomRect {
anchors.fill: parent
anchors.margins: Tokens.spacing.extraSmall
radius: Tokens.rounding.medium
color: Colors.tPalette.m3surfaceContainer
clip: true
FadeImage {
id: attImage
+1 -3
View File
@@ -63,7 +63,7 @@ Item {
}
}
ClippingRectangle {
Item {
id: clipRect
anchors.bottom: parent.bottom
@@ -71,8 +71,6 @@ Item {
anchors.right: parent.right
anchors.top: title.bottom
anchors.topMargin: 10
color: "transparent"
radius: 6
Loader {
active: opacity > 0
+14 -9
View File
@@ -4,7 +4,7 @@ import ZShell.Config
import qs.Components
import qs.Services
CustomClippingRect {
CustomRect {
id: root
required property color accent
@@ -19,15 +19,20 @@ CustomClippingRect {
implicitWidth: 450
radius: Tokens.rounding.largeIncreased
CustomRect {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.top: parent.top
color: Qt.alpha(root.accent, 0.05)
implicitWidth: parent.width * root.usage
CustomClippingRect {
anchors.fill: parent
radius: parent.radius
Behavior on implicitWidth {
Anim {}
CustomRect {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.top: parent.top
color: Qt.alpha(root.accent, 0.05)
implicitWidth: parent.width * root.usage
Behavior on implicitWidth {
Anim {}
}
}
}
+3 -2
View File
@@ -149,7 +149,7 @@ ColumnLayout {
}
}
VerticalFadeFlickable {
Flickable {
id: flickable
Layout.fillHeight: true
@@ -158,7 +158,8 @@ ColumnLayout {
bottomMargin: Tokens.padding.extraLarge
topMargin: Tokens.padding.large
fadeAmount: 0.1
clip: true
// fadeAmount: 0.1
contentHeight: root.contentChild?.implicitHeight ?? 0
contentItem.children: [root.contentChild]
+3 -2
View File
@@ -6,7 +6,7 @@ import qs.Components
import ZShell.Config
import qs.Services
CustomClippingRect {
Item {
id: root
property color blobColor: Colors.tPalette.m3surfaceContainerLow
@@ -21,7 +21,6 @@ CustomClippingRect {
implicitHeight: sState.screen.height * 0.7
implicitWidth: implicitHeight * ratio
radius: Tokens.rounding.largeIncreased + Tokens.padding.small
Behavior on blobColor {
CAnim {}
@@ -46,6 +45,8 @@ CustomClippingRect {
borderTop: Tokens.padding.small
group: blobGroup
opacity: root.blobColor.a
// outerRadius: 10
outerRadius: Tokens.rounding.largeIncreased + Tokens.padding.small
radius: Tokens.rounding.largeIncreased
}
+11 -14
View File
@@ -2,8 +2,9 @@ pragma ComponentBehavior: Bound
import Quickshell
import QtQuick
import qs.Components
import ZShell.Config
import ZShell.Components
import qs.Components
Item {
id: root
@@ -27,21 +28,17 @@ Item {
}
}
CustomClippingRect {
anchors.fill: parent
Loader {
id: content
Loader {
id: content
active: root.shouldBeActive || root.visible
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
active: root.shouldBeActive || root.visible
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
sourceComponent: Content {
sState.animatingContainer: content.opacity < 1
sState.currentPageIdx: ["wallpaper"].indexOf(root.queuedMode)
sState.screen: root.screen
}
sourceComponent: Content {
sState.animatingContainer: content.opacity < 1
sState.currentPageIdx: ["wallpaper"].indexOf(root.queuedMode)
sState.screen: root.screen
}
}
}