Visibility service for handling active popups

This commit is contained in:
Benjamin Palko 2025-07-31 11:47:46 -04:00
parent 89cf6f315b
commit 9873324823
4 changed files with 24 additions and 11 deletions

16
services/Visibility.qml Normal file
View 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;
}
}