feat: use custom wayland layer-shell to render wallpaper to reduce vram
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import qs.Modules.Wallpaper
|
||||
|
||||
Scope {
|
||||
Component.onCompleted: {
|
||||
Wallpaper;
|
||||
}
|
||||
}
|
||||
@@ -139,12 +139,13 @@ Item {
|
||||
id: dialogBg
|
||||
|
||||
anchors.fill: parent
|
||||
bottomLeftRadius: Tokens.rounding.largeIncreased
|
||||
bottomRightRadius: Tokens.rounding.largeIncreased
|
||||
bottomLeftRadius: root.last ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
||||
bottomRightRadius: root.last ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
||||
deformScale: 0
|
||||
group: blobGroup
|
||||
opacity: blobGroup.color.a * (root.enabled ? 1 : 0.5)
|
||||
radius: Tokens.rounding.extraSmall
|
||||
topLeftRadius: root.first ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
||||
topRightRadius: root.first ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
||||
}
|
||||
|
||||
RowButton {
|
||||
@@ -153,9 +154,11 @@ Item {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
color: "transparent"
|
||||
height: Math.min(implicitHeight, parent.height) // Clamp to parent height due to overshoot anim
|
||||
first: root.first
|
||||
height: Math.min(implicitHeight, parent.height)
|
||||
icon: root.icon
|
||||
last: true
|
||||
last: root.last
|
||||
subtext: root.subtext
|
||||
text: root.label
|
||||
|
||||
transform: Matrix4x4 {
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import QtQuick
|
||||
import qs.Components
|
||||
import qs.Helpers
|
||||
import ZShell.Internal
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
readonly property var displayData: Wallpapers.getCrop(screen.name)
|
||||
required property ShellScreen screen
|
||||
property size screenResolution: Qt.size(screen.width * screenScale, screen.height * screenScale)
|
||||
property real screenScale: Hyprland.monitorFor(screen).scale
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
Component.onCompleted: Hyprland.refreshMonitors()
|
||||
|
||||
WallpaperImage {
|
||||
id: img
|
||||
|
||||
anchors.fill: parent
|
||||
cropHeight: root.displayData?.height ?? 1.0
|
||||
cropWidth: root.displayData?.width ?? 1.0
|
||||
cropX: root.displayData?.x ?? 0.0
|
||||
cropY: root.displayData?.y ?? 0.0
|
||||
fadeDuration: 150
|
||||
screenResolution: root.screenResolution
|
||||
source: Wallpapers.current
|
||||
|
||||
Behavior on cropHeight {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
Behavior on cropWidth {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
Behavior on cropX {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
Behavior on cropY {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,46 +1,49 @@
|
||||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import Quickshell.Wayland
|
||||
import ZShell.Config
|
||||
import qs.Modules.DesktopIcons
|
||||
import ZShell.Internal
|
||||
import qs.Components
|
||||
import qs.Helpers
|
||||
|
||||
Loader {
|
||||
active: Config.background.enabled
|
||||
asynchronous: false
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
sourceComponent: Variants {
|
||||
WallpaperService {
|
||||
id: wallpaper
|
||||
|
||||
path: Wallpapers.current
|
||||
}
|
||||
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
|
||||
PanelWindow {
|
||||
id: root
|
||||
|
||||
WallpaperObject {
|
||||
readonly property var crops: Wallpapers.getCrop(modelData.name)
|
||||
required property var modelData
|
||||
|
||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||
WlrLayershell.layer: WlrLayer.Background
|
||||
WlrLayershell.namespace: "ZShell-Wallpaper"
|
||||
color: "transparent"
|
||||
screen: modelData
|
||||
surfaceFormat.opaque: true
|
||||
cropHeight: crops?.height ?? 1.0
|
||||
cropWidth: crops?.width ?? 1.0
|
||||
cropX: crops?.x ?? 0.0
|
||||
cropY: crops?.y ?? 0.0
|
||||
screen: modelData.name
|
||||
service: wallpaper
|
||||
zoom: crops?.zoom ?? 1.0
|
||||
|
||||
anchors {
|
||||
bottom: true
|
||||
left: true
|
||||
right: true
|
||||
top: true
|
||||
Behavior on cropHeight {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
|
||||
WallBackground {
|
||||
screen: root.screen
|
||||
Behavior on cropWidth {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: loader
|
||||
|
||||
active: Config.general.desktopIcons
|
||||
anchors.fill: parent
|
||||
|
||||
sourceComponent: DesktopIcons {
|
||||
Behavior on cropX {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
Behavior on cropY {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user