From f0977edf289d8384f1d37f85adb7ede04405d775 Mon Sep 17 00:00:00 2001 From: Uyanide Date: Thu, 19 Mar 2026 00:26:21 +0100 Subject: [PATCH] qs: remove fakebar (why does this thing exist in the first place :/ ) & more about wallpaper --- .../quickshell/Modules/Misc/Corners.qml | 23 --------- .../Modules/Sidebar/Modules/WallpaperCard.qml | 1 - .../quickshell/Services/BackgroundService.qml | 50 +++++++++++-------- 3 files changed, 28 insertions(+), 46 deletions(-) diff --git a/config/quickshell/.config/quickshell/Modules/Misc/Corners.qml b/config/quickshell/.config/quickshell/Modules/Misc/Corners.qml index a134600..4ec63ed 100644 --- a/config/quickshell/.config/quickshell/Modules/Misc/Corners.qml +++ b/config/quickshell/.config/quickshell/Modules/Misc/Corners.qml @@ -35,29 +35,6 @@ Scope { property int leftOffset: leftBar?.isOpen ? leftBar.barWidth : 0 property int rightOffset: rightBar?.isOpen ? rightBar.barWidth : 0 - PanelWindow { - id: fakeBar - - anchors.top: true - anchors.left: true - anchors.right: true - color: "transparent" - screen: modelData - WlrLayershell.exclusionMode: ExclusionMode.Ignore - visible: true - WlrLayershell.layer: WlrLayer.Background - aboveWindows: false - WlrLayershell.namespace: namespace - implicitHeight: topMargin - - Rectangle { - anchors.fill: parent - color: Colors.mSurface - opacity: rootScope.opacity - } - - } - PanelWindow { id: topLeftPanel diff --git a/config/quickshell/.config/quickshell/Modules/Sidebar/Modules/WallpaperCard.qml b/config/quickshell/.config/quickshell/Modules/Sidebar/Modules/WallpaperCard.qml index 2c7dd53..da73cd5 100644 --- a/config/quickshell/.config/quickshell/Modules/Sidebar/Modules/WallpaperCard.qml +++ b/config/quickshell/.config/quickshell/Modules/Sidebar/Modules/WallpaperCard.qml @@ -16,7 +16,6 @@ RowLayout { height: Style.baseWidgetSize * 3.2 + Style.marginS * 3 radius: Style.radiusM imagePath: BackgroundService.displayPath - fallbackIcon: "wallpaper" layer.enabled: true MouseArea { diff --git a/config/quickshell/.config/quickshell/Services/BackgroundService.qml b/config/quickshell/.config/quickshell/Services/BackgroundService.qml index 1cb0b34..fb0e2bf 100644 --- a/config/quickshell/.config/quickshell/Services/BackgroundService.qml +++ b/config/quickshell/.config/quickshell/Services/BackgroundService.qml @@ -11,8 +11,8 @@ Singleton { readonly property string backgroundWidth: "2560" readonly property string backgroundHeight: "1440" - property string _cachedPath: "" - property string _previewPath: "" + property string cachedPath: "" + property string previewPath: "" property string displayPath: "" property bool inPreviewMode: false // Preserved for getBlurredOverview @@ -29,27 +29,25 @@ Singleton { ImageCacheService.getLarge(SettingsService.backgroundPath, backgroundWidth, backgroundHeight, function(path) { if (!path) { Logger.e("BackgroundService", "Failed to load background image from path: " + SettingsService.backgroundPath); + cachedPath = ""; return ; } - _cachedPath = path; + cachedPath = path; Logger.i("BackgroundService", "Loaded background image as cached path: " + path); - setDisplayTimer.restart(); }); } function previewWallpaper(path) { if (!path) { - _previewPath = ""; - setDisplayTimer.restart(); + previewPath = ""; return ; } ImageCacheService.checkFileExists(path, function(exists) { if (!exists) { - _previewPath = ""; + previewPath = ""; return ; } - _previewPath = path; - setDisplayTimer.restart(); + previewPath = path; }); } @@ -57,9 +55,8 @@ Singleton { if (!path) return ; - _previewPath = ""; // clear preview path - _cachedPath = ""; // clear cached path - setDisplayTimer.restart(); + previewPath = ""; // clear preview path + cachedPath = ""; // clear cached path ImageCacheService.checkFileExists(path, function(exists) { if (!exists) return ; @@ -75,6 +72,25 @@ Singleton { } + function updateDisplay() { + if (root.previewPath) { + root.displayPath = root.previewPath; + root.inPreviewMode = true; + } else if (root.cachedPath) { + root.displayPath = root.cachedPath; + root.inPreviewMode = false; + } else { + root.displayPath = ""; + root.inPreviewMode = false; + } + } + + onCachedPathChanged: { + Qt.callLater(updateDisplay); + } + onPreviewPathChanged: { + Qt.callLater(updateDisplay); + } Component.onCompleted: { loadTimer.start(); } @@ -97,16 +113,6 @@ Singleton { running: false repeat: false onTriggered: { - if (root._previewPath) { - root.displayPath = root._previewPath; - root.inPreviewMode = true; - } else if (root._cachedPath) { - root.displayPath = root._cachedPath; - root.inPreviewMode = false; - } else { - root.displayPath = ""; - root.inPreviewMode = false; - } } }