diff options
Diffstat (limited to 'modules/bar/popouts')
| -rw-r--r-- | modules/bar/popouts/Content.qml | 20 | ||||
| -rw-r--r-- | modules/bar/popouts/Wrapper.qml | 4 |
2 files changed, 21 insertions, 3 deletions
diff --git a/modules/bar/popouts/Content.qml b/modules/bar/popouts/Content.qml index a3ddea4..086a558 100644 --- a/modules/bar/popouts/Content.qml +++ b/modules/bar/popouts/Content.qml @@ -11,9 +11,23 @@ Item { required property ShellScreen screen + property string currentName + property real currentCenter + property bool hasCurrent + + Behavior on currentCenter { + enabled: root.hasCurrent + + NumberAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.emphasized + } + } + anchors.centerIn: parent - implicitWidth: Popouts.hasCurrent ? (content.children.find(c => c.shouldBeActive)?.implicitWidth ?? 0) + Appearance.padding.large * 2 : 0 + implicitWidth: root.hasCurrent ? (content.children.find(c => c.shouldBeActive)?.implicitWidth ?? 0) + Appearance.padding.large * 2 : 0 implicitHeight: (content.children.find(c => c.shouldBeActive)?.implicitHeight ?? 0) + Appearance.padding.large * 2 Item { @@ -70,7 +84,7 @@ Item { } Behavior on implicitHeight { - enabled: Popouts.hasCurrent + enabled: root.hasCurrent Anim { easing.bezierCurve: Appearance.anim.curves.emphasized @@ -81,7 +95,7 @@ Item { id: popout required property string name - property bool shouldBeActive: Popouts.currentName === name + property bool shouldBeActive: root.currentName === name anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right diff --git a/modules/bar/popouts/Wrapper.qml b/modules/bar/popouts/Wrapper.qml index 47b8af2..f304ea7 100644 --- a/modules/bar/popouts/Wrapper.qml +++ b/modules/bar/popouts/Wrapper.qml @@ -8,6 +8,10 @@ Item { required property ShellScreen screen + property alias currentName: content.currentName + property alias currentCenter: content.currentCenter + property alias hasCurrent: content.hasCurrent + visible: width > 0 && height > 0 implicitWidth: content.implicitWidth |