aboutsummaryrefslogtreecommitdiff
path: root/modules/system/quickshell/AnchoredPopup.qml
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system/quickshell/AnchoredPopup.qml')
-rw-r--r--modules/system/quickshell/AnchoredPopup.qml77
1 files changed, 0 insertions, 77 deletions
diff --git a/modules/system/quickshell/AnchoredPopup.qml b/modules/system/quickshell/AnchoredPopup.qml
deleted file mode 100644
index 76d4ccd..0000000
--- a/modules/system/quickshell/AnchoredPopup.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-import QtQuick
-import Quickshell
-import Quickshell.Wayland
-
-Scope {
- id: root
-
- property string popupName: ""
- property var anchorWindow
- property var anchorItem
- property int popupGap: Theme.popupGap
- readonly property bool open: GlobalState.activePopup === popupName
- default property alias content: contentRoot.data
-
- signal opened
- signal closed
-
- PanelWindow {
- visible: root.open
- anchors {
- top: true
- bottom: true
- left: true
- right: true
- }
- WlrLayershell.layer: WlrLayer.Top
- WlrLayershell.margins.top: Theme.barHeight
- WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
- exclusionMode: ExclusionMode.Ignore
- color: Theme.transparent
-
- MouseArea {
- anchors.fill: parent
- acceptedButtons: Qt.AllButtons
- hoverEnabled: true
- onClicked: GlobalState.close()
- onWheel: wheel => wheel.accepted = true
- }
- }
-
- PopupWindow {
- id: popup
- visible: root.open
- grabFocus: true
- implicitWidth: contentRoot.childrenRect.width
- implicitHeight: contentRoot.childrenRect.height
-
- anchor {
- window: root.anchorWindow
- item: root.anchorItem
- edges: Edges.Bottom
- gravity: Edges.Bottom
- margins.top: root.popupGap
- }
-
- color: Theme.transparent
-
- onVisibleChanged: {
- if (visible) {
- anchor.updateAnchor();
- contentRoot.forceActiveFocus();
- root.opened();
- } else {
- root.closed();
- }
- }
-
- Item {
- id: contentRoot
- focus: true
- width: childrenRect.width
- height: childrenRect.height
-
- Keys.onEscapePressed: GlobalState.close()
- }
- }
-}