forked from Shinonome/dots-hyprland
wallpaper selector: allow making system picker the default
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user