summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/bar/popouts/Content.qml42
-rw-r--r--modules/bar/popouts/TrayMenu.qml9
2 files changed, 35 insertions, 16 deletions
diff --git a/modules/bar/popouts/Content.qml b/modules/bar/popouts/Content.qml
index 38fcb22..43a0a09 100644
--- a/modules/bar/popouts/Content.qml
+++ b/modules/bar/popouts/Content.qml
@@ -15,16 +15,6 @@ Item {
property real currentCenter
property bool hasCurrent
- Behavior on currentCenter {
- enabled: root.implicitWidth > 0
-
- NumberAnimation {
- duration: Appearance.anim.durations.normal
- easing.type: Easing.BezierSpline
- easing.bezierCurve: Appearance.anim.curves.emphasized
- }
- }
-
anchors.centerIn: parent
implicitWidth: hasCurrent ? (content.children.find(c => c.shouldBeActive)?.implicitWidth ?? 0) + Appearance.padding.large * 2 : 0
@@ -70,8 +60,26 @@ Item {
required property int index
name: `traymenu${index}`
- sourceComponent: TrayMenu {
- trayItem: trayMenu.modelData.menu
+ sourceComponent: trayMenuComp
+
+ Connections {
+ target: root
+
+ function onHasCurrentChanged(): void {
+ if (root.hasCurrent && trayMenu.shouldBeActive) {
+ trayMenu.sourceComponent = null;
+ trayMenu.sourceComponent = trayMenuComp;
+ }
+ }
+ }
+
+ Component {
+ id: trayMenuComp
+
+ TrayMenu {
+ popouts: root
+ trayItem: trayMenu.modelData.menu
+ }
}
}
}
@@ -91,6 +99,16 @@ Item {
}
}
+ Behavior on currentCenter {
+ enabled: root.implicitWidth > 0
+
+ NumberAnimation {
+ duration: Appearance.anim.durations.normal
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.emphasized
+ }
+ }
+
component Popout: Loader {
id: popout
diff --git a/modules/bar/popouts/TrayMenu.qml b/modules/bar/popouts/TrayMenu.qml
index f7d0928..9b48385 100644
--- a/modules/bar/popouts/TrayMenu.qml
+++ b/modules/bar/popouts/TrayMenu.qml
@@ -11,6 +11,7 @@ import QtQuick.Controls
StackView {
id: root
+ required property Item popouts
required property QsMenuHandle trayItem
implicitWidth: currentItem.implicitWidth
@@ -27,9 +28,7 @@ StackView {
component Anim: Transition {
NumberAnimation {
- duration: 0 // Appearance.anim.durations.normal
- easing.type: Easing.BezierSpline
- easing.bezierCurve: Appearance.anim.curves.standard
+ duration: 0
}
}
@@ -114,8 +113,10 @@ StackView {
handle: entry,
isSubMenu: true
}));
- else
+ else {
item.modelData.triggered();
+ root.popouts.hasCurrent = false;
+ }
}
}