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 int longBreak: 900
} }
} }
property JsonObject wallpaperSelector: JsonObject {
property bool useSystemFileDialog: false
}
property JsonObject windows: JsonObject { property JsonObject windows: JsonObject {
property bool showTitlebar: true // Client-side decoration for shell apps property bool showTitlebar: true // Client-side decoration for shell apps
property bool centerTitle: true 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 { IpcHandler {
target: "wallpaperSelector" target: "wallpaperSelector"
function toggle(): void { function toggle(): void {
GlobalStates.wallpaperSelectorOpen = !GlobalStates.wallpaperSelectorOpen root.toggleWallpaperSelector();
} }
} }
GlobalShortcut { GlobalShortcut {
name: "wallpaperSelectorToggle" name: "wallpaperSelectorToggle"
description: "Toggle wallpaper selector" description: "Toggle wallpaper selector"
onPressed: { onPressed: root.toggleWallpaperSelector();
GlobalStates.wallpaperSelectorOpen = !GlobalStates.wallpaperSelectorOpen;
}
} }
} }

View file

@ -316,12 +316,17 @@ MouseArea {
Wallpapers.openFallbackPicker(root.useDarkMode); Wallpapers.openFallbackPicker(root.useDarkMode);
GlobalStates.wallpaperSelectorOpen = false; GlobalStates.wallpaperSelectorOpen = false;
} }
altAction: () => {
Wallpapers.openFallbackPicker(root.useDarkMode);
GlobalStates.wallpaperSelectorOpen = false;
Config.options.wallpaperSelector.useSystemFileDialog = true
}
contentItem: MaterialSymbol { contentItem: MaterialSymbol {
text: "open_in_new" text: "open_in_new"
iconSize: Appearance.font.pixelSize.larger iconSize: Appearance.font.pixelSize.larger
} }
StyledToolTip { 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")
} }
} }