qs: remove fakebar (why does this thing exist in the first place :/ ) & more about wallpaper

This commit is contained in:
2026-03-19 00:26:21 +01:00
parent d0c48875c7
commit f0977edf28
3 changed files with 28 additions and 46 deletions
@@ -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
@@ -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 {
@@ -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;
}
}
}