mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 14:59:27 -05:00
wallpaper selector: add click outside to close
This commit is contained in:
@@ -15,6 +15,7 @@ Scope {
|
||||
id: root
|
||||
|
||||
Loader {
|
||||
id: wallpaperSelectorLoader
|
||||
active: GlobalStates.wallpaperSelectorOpen
|
||||
|
||||
sourceComponent: PanelWindow {
|
||||
@@ -35,12 +36,25 @@ Scope {
|
||||
left: true
|
||||
right: true
|
||||
}
|
||||
|
||||
margins {
|
||||
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 {
|
||||
id: content
|
||||
anchors {
|
||||
top: parent.top
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
|
||||
Reference in New Issue
Block a user