Visibility service for handling active popups
This commit is contained in:
parent
89cf6f315b
commit
9873324823
4 changed files with 24 additions and 11 deletions
16
services/Visibility.qml
Normal file
16
services/Visibility.qml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
pragma Singleton
|
||||
|
||||
import qs.widgets
|
||||
import Quickshell
|
||||
|
||||
Singleton {
|
||||
property StyledPopupWindow activePopup
|
||||
|
||||
function togglePopup(popup: StyledPopupWindow) {
|
||||
if (activePopup && popup != activePopup) {
|
||||
activePopup.state = "";
|
||||
}
|
||||
popup.state = popup.state == "opened" ? "" : "opened";
|
||||
activePopup = popup;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue