fixed destroying menu on focus loss
This commit is contained in:
@@ -6,6 +6,7 @@ import QtQuick.Effects
|
|||||||
import Caelestia
|
import Caelestia
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Widgets
|
import Quickshell.Widgets
|
||||||
|
import Quickshell.Hyprland
|
||||||
import Quickshell.Services.SystemTray
|
import Quickshell.Services.SystemTray
|
||||||
import qs.Modules
|
import qs.Modules
|
||||||
|
|
||||||
@@ -53,6 +54,13 @@ MouseArea {
|
|||||||
anchor.margins {
|
anchor.margins {
|
||||||
left: -270
|
left: -270
|
||||||
}
|
}
|
||||||
|
HyprlandFocusGrab {
|
||||||
|
id: grab
|
||||||
|
windows: [ trayMenu ]
|
||||||
|
onCleared: {
|
||||||
|
trayMenu.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -61,6 +69,7 @@ MouseArea {
|
|||||||
root.item.activate();
|
root.item.activate();
|
||||||
} else if ( mouse.button === Qt.RightButton ) {
|
} else if ( mouse.button === Qt.RightButton ) {
|
||||||
trayMenu.visible = !trayMenu.visible;
|
trayMenu.visible = !trayMenu.visible;
|
||||||
|
grab.active = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-10
@@ -20,17 +20,17 @@ PopupWindow {
|
|||||||
menu: root.menu
|
menu: root.menu
|
||||||
}
|
}
|
||||||
|
|
||||||
HyprlandFocusGrab {
|
// HyprlandFocusGrab {
|
||||||
id: grab
|
// id: grab
|
||||||
windows: [ root ]
|
// windows: [ root ]
|
||||||
onCleared: {
|
// onCleared: {
|
||||||
root.visible = false;
|
// root.visible = false;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
onVisibleChanged: {
|
// onVisibleChanged: {
|
||||||
grab.active = root.visible;
|
// grab.active = root.visible;
|
||||||
}
|
// }
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: menuRect
|
id: menuRect
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
Reference in New Issue
Block a user