wallpaper selector: add click outside to close

This commit is contained in:
end-4
2025-08-22 22:47:21 +07:00
parent 28256c0a72
commit a25a3c186b
@@ -15,6 +15,7 @@ Scope {
id: root id: root
Loader { Loader {
id: wallpaperSelectorLoader
active: GlobalStates.wallpaperSelectorOpen active: GlobalStates.wallpaperSelectorOpen
sourceComponent: PanelWindow { sourceComponent: PanelWindow {
@@ -35,12 +36,25 @@ Scope {
left: true left: true
right: true right: true
} }
margins { margins {
top: Appearance.sizes.barHeight + Appearance.sizes.hyprlandGapsOut top: Appearance.sizes.barHeight + Appearance.sizes.hyprlandGapsOut
} }
mask: Region {
item: content
}
HyprlandFocusGrab { // Click outside to close
id: grab
windows: [ panelWindow ]
active: wallpaperSelectorLoader.active
onCleared: () => {
if (!active) GlobalStates.wallpaperSelectorOpen = false;
}
}
WallpaperSelectorContent { WallpaperSelectorContent {
id: content
anchors { anchors {
top: parent.top top: parent.top
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter