forked from Shinonome/dots-hyprland
wallpaper selector: add click outside to close
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user