From c4a2574befa81d9f1d60ab2e6b2354361c9440f1 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Sun, 19 Apr 2026 09:01:28 +0200 Subject: [PATCH] Fade the dock thumbnail popup in and out The popup snapped to visible/hidden instantly while every other surface in the shell uses animated transitions. Add an opacity fade over shortDuration so it matches the rest of the motion language. State cleanup waits for the fade-out to finish. --- .../homescreens/folio/qml/FavouritesBar.qml | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/containments/homescreens/folio/qml/FavouritesBar.qml b/containments/homescreens/folio/qml/FavouritesBar.qml index ec5df0d5..20f10dd6 100644 --- a/containments/homescreens/folio/qml/FavouritesBar.qml +++ b/containments/homescreens/folio/qml/FavouritesBar.qml @@ -599,7 +599,7 @@ MouseArea { id: thumbnailShowTimer interval: Kirigami.Units.toolTipDelay onTriggered: { - thumbnailPopup.visible = true + thumbnailPopup.showing = true } } @@ -607,7 +607,7 @@ MouseArea { id: thumbnailHideTimer interval: 300 onTriggered: { - thumbnailPopup.visible = false + thumbnailPopup.showing = false root.hoveredTaskIndex = -1 } } @@ -620,10 +620,21 @@ MouseArea { property var windowIds: [] property bool isGroup: false property bool popupHovered: false + property bool showing: false - function open() { visible = true } - function close() { visible = false } - readonly property bool opened: visible + function open() { showing = true } + function close() { showing = false } + readonly property bool opened: showing + + visible: showing || fadeAnim.running + opacity: showing ? 1 : 0 + Behavior on opacity { + NumberAnimation { + id: fadeAnim + duration: Kirigami.Units.shortDuration + easing.type: Easing.InOutQuad + } + } flags: Qt.ToolTip | Qt.FramelessWindowHint | Qt.WindowDoesNotAcceptFocus color: "transparent" @@ -650,8 +661,8 @@ MouseArea { return Math.max(0, Math.min(Screen.height - height, delegateGlobal.y - height - Kirigami.Units.smallSpacing)) } - onVisibleChanged: { - if (!visible) { + onShowingChanged: { + if (!showing && !fadeAnim.running) { windowIds = [] targetDelegate = null taskIndex = -1 @@ -659,6 +670,18 @@ MouseArea { } } + Connections { + target: fadeAnim + function onRunningChanged() { + if (!fadeAnim.running && !thumbnailPopup.showing) { + thumbnailPopup.windowIds = [] + thumbnailPopup.targetDelegate = null + thumbnailPopup.taskIndex = -1 + thumbnailPopup.isGroup = false + } + } + } + Rectangle { anchors.fill: parent color: Kirigami.Theme.backgroundColor