Files
noctalia-shell/Modules/Background/Overview.qml
T
ItsLemmy 0e41306f73 Wayland Layers: Breaking changes
- renamed some layers from "quickshell-*" to "noctalia-*"
- added screen name to all layers, ex: "noctalia-wallpaper-DP1"
- added a way to disable overview management in the settings, this allow
stationnary wallpaper on niri
2025-11-04 20:07:48 -05:00

88 lines
2.2 KiB
QML

import QtQuick
import QtQuick.Effects
import Quickshell
import Quickshell.Wayland
import qs.Commons
import qs.Services
import qs.Widgets
Loader {
active: CompositorService.isNiri && Settings.data.wallpaper.enabled && Settings.data.wallpaper.overviewEnabled
sourceComponent: Variants {
model: Quickshell.screens
delegate: PanelWindow {
id: panelWindow
required property ShellScreen modelData
property string wallpaper: ""
Component.onCompleted: {
if (modelData) {
Logger.d("Overview", "Loading overview for Niri on", modelData.name)
}
setWallpaperInitial()
}
// External state management
Connections {
target: WallpaperService
function onWallpaperChanged(screenName, path) {
if (screenName === modelData.name) {
wallpaper = path
}
}
}
function setWallpaperInitial() {
if (!WallpaperService || !WallpaperService.isInitialized) {
Qt.callLater(setWallpaperInitial)
return
}
const wallpaperPath = WallpaperService.getWallpaper(modelData.name)
if (wallpaperPath && wallpaperPath !== wallpaper) {
wallpaper = wallpaperPath
}
}
color: Color.transparent
screen: modelData
WlrLayershell.layer: WlrLayer.Background
WlrLayershell.exclusionMode: ExclusionMode.Ignore
WlrLayershell.namespace: "noctalia-overview-" + (screen?.name || "unknown")
anchors {
top: true
bottom: true
right: true
left: true
}
Image {
id: bgImage
anchors.fill: parent
fillMode: Image.PreserveAspectCrop
source: wallpaper
smooth: true
mipmap: false
cache: false
asynchronous: true
// Image is heavily blurred, so might as well save a lot of memory here.
sourceSize: Qt.size(1280, 720)
}
MultiEffect {
anchors.fill: parent
source: bgImage
autoPaddingEnabled: false
blurEnabled: true
blur: 1.0
blurMax: 64
colorization: Style.opacityMedium
colorizationColor: Settings.data.colorSchemes.darkMode ? Color.mSurface : Color.mOnSurface
}
}
}
}