24 lines
762 B
QML
24 lines
762 B
QML
// GlobalStates.qml - a place to store global state variables accessible from any QML file.
|
|
pragma Singleton
|
|
import Quickshell
|
|
import QtQuick
|
|
|
|
Singleton {
|
|
id: root
|
|
|
|
// Used by the merged overview module (own/modules/overview) — see own/modules/overview/CREDITS.md
|
|
property bool overviewOpen: false
|
|
|
|
readonly property QtObject popups: QtObject {
|
|
property string active: ""
|
|
property real anchorX: 0
|
|
|
|
function open(name, ax) { popups.anchorX = ax ?? 0; popups.active = name }
|
|
function close() { popups.active = "" }
|
|
function toggle(name, ax) {
|
|
if (popups.active === name) { popups.active = "" }
|
|
else { popups.anchorX = ax ?? 0; popups.active = name }
|
|
}
|
|
}
|
|
}
|