wallpaper selector: allow making system picker the default

This commit is contained in:
end-4 2025-09-15 21:52:58 +02:00
parent d3a1bd52c7
commit 074f8ed902
3 changed files with 21 additions and 6 deletions

View file

@ -338,7 +338,11 @@ Singleton {
property int longBreak: 900
}
}
property JsonObject wallpaperSelector: JsonObject {
property bool useSystemFileDialog: false
}
property JsonObject windows: JsonObject {
property bool showTitlebar: true // Client-side decoration for shell apps
property bool centerTitle: true

View file

@ -57,19 +57,25 @@ Scope {
}
}
function toggleWallpaperSelector() {
if (Config.options.wallpaperSelector.useSystemFileDialog) {
Wallpapers.openFallbackPicker(Appearance.m3colors.darkmode);
return;
}
GlobalStates.wallpaperSelectorOpen = !GlobalStates.wallpaperSelectorOpen
}
IpcHandler {
target: "wallpaperSelector"
function toggle(): void {
GlobalStates.wallpaperSelectorOpen = !GlobalStates.wallpaperSelectorOpen
root.toggleWallpaperSelector();
}
}
GlobalShortcut {
name: "wallpaperSelectorToggle"
description: "Toggle wallpaper selector"
onPressed: {
GlobalStates.wallpaperSelectorOpen = !GlobalStates.wallpaperSelectorOpen;
}
onPressed: root.toggleWallpaperSelector();
}
}

View file

@ -316,12 +316,17 @@ MouseArea {
Wallpapers.openFallbackPicker(root.useDarkMode);
GlobalStates.wallpaperSelectorOpen = false;
}
altAction: () => {
Wallpapers.openFallbackPicker(root.useDarkMode);
GlobalStates.wallpaperSelectorOpen = false;
Config.options.wallpaperSelector.useSystemFileDialog = true
}
contentItem: MaterialSymbol {
text: "open_in_new"
iconSize: Appearance.font.pixelSize.larger
}
StyledToolTip {
content: Translation.tr("Use the system file picker instead")
content: Translation.tr("Use the system file picker instead\nRight-click to make this the default behavior")
}
}