qs: remove fakebar (why does this thing exist in the first place :/ ) & more about wallpaper
This commit is contained in:
@@ -35,29 +35,6 @@ Scope {
|
|||||||
property int leftOffset: leftBar?.isOpen ? leftBar.barWidth : 0
|
property int leftOffset: leftBar?.isOpen ? leftBar.barWidth : 0
|
||||||
property int rightOffset: rightBar?.isOpen ? rightBar.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 {
|
PanelWindow {
|
||||||
id: topLeftPanel
|
id: topLeftPanel
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ RowLayout {
|
|||||||
height: Style.baseWidgetSize * 3.2 + Style.marginS * 3
|
height: Style.baseWidgetSize * 3.2 + Style.marginS * 3
|
||||||
radius: Style.radiusM
|
radius: Style.radiusM
|
||||||
imagePath: BackgroundService.displayPath
|
imagePath: BackgroundService.displayPath
|
||||||
fallbackIcon: "wallpaper"
|
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ Singleton {
|
|||||||
|
|
||||||
readonly property string backgroundWidth: "2560"
|
readonly property string backgroundWidth: "2560"
|
||||||
readonly property string backgroundHeight: "1440"
|
readonly property string backgroundHeight: "1440"
|
||||||
property string _cachedPath: ""
|
property string cachedPath: ""
|
||||||
property string _previewPath: ""
|
property string previewPath: ""
|
||||||
property string displayPath: ""
|
property string displayPath: ""
|
||||||
property bool inPreviewMode: false
|
property bool inPreviewMode: false
|
||||||
// Preserved for getBlurredOverview
|
// Preserved for getBlurredOverview
|
||||||
@@ -29,27 +29,25 @@ Singleton {
|
|||||||
ImageCacheService.getLarge(SettingsService.backgroundPath, backgroundWidth, backgroundHeight, function(path) {
|
ImageCacheService.getLarge(SettingsService.backgroundPath, backgroundWidth, backgroundHeight, function(path) {
|
||||||
if (!path) {
|
if (!path) {
|
||||||
Logger.e("BackgroundService", "Failed to load background image from path: " + SettingsService.backgroundPath);
|
Logger.e("BackgroundService", "Failed to load background image from path: " + SettingsService.backgroundPath);
|
||||||
|
cachedPath = "";
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
_cachedPath = path;
|
cachedPath = path;
|
||||||
Logger.i("BackgroundService", "Loaded background image as cached path: " + path);
|
Logger.i("BackgroundService", "Loaded background image as cached path: " + path);
|
||||||
setDisplayTimer.restart();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function previewWallpaper(path) {
|
function previewWallpaper(path) {
|
||||||
if (!path) {
|
if (!path) {
|
||||||
_previewPath = "";
|
previewPath = "";
|
||||||
setDisplayTimer.restart();
|
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
ImageCacheService.checkFileExists(path, function(exists) {
|
ImageCacheService.checkFileExists(path, function(exists) {
|
||||||
if (!exists) {
|
if (!exists) {
|
||||||
_previewPath = "";
|
previewPath = "";
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
_previewPath = path;
|
previewPath = path;
|
||||||
setDisplayTimer.restart();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,9 +55,8 @@ Singleton {
|
|||||||
if (!path)
|
if (!path)
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
_previewPath = ""; // clear preview path
|
previewPath = ""; // clear preview path
|
||||||
_cachedPath = ""; // clear cached path
|
cachedPath = ""; // clear cached path
|
||||||
setDisplayTimer.restart();
|
|
||||||
ImageCacheService.checkFileExists(path, function(exists) {
|
ImageCacheService.checkFileExists(path, function(exists) {
|
||||||
if (!exists)
|
if (!exists)
|
||||||
return ;
|
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: {
|
Component.onCompleted: {
|
||||||
loadTimer.start();
|
loadTimer.start();
|
||||||
}
|
}
|
||||||
@@ -97,16 +113,6 @@ Singleton {
|
|||||||
running: false
|
running: false
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: {
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user