From a5ac1ee77ae11a8d5728be8f910f54eba6a5f76c Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 26 Jul 2025 16:21:03 +0800 Subject: ws: unify handling resuming previous activerect context fixes a problem where when exiting from inner to outter, the inner's onExit triggers before the outter's enter, making it attempt to resume then stopped by the outter's enter --- bar/Workspace.qml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'bar') diff --git a/bar/Workspace.qml b/bar/Workspace.qml index f8b8510..0de5c5b 100644 --- a/bar/Workspace.qml +++ b/bar/Workspace.qml @@ -78,12 +78,12 @@ Item { easing.type: Easing.InOutQuad } } - Behavior on implicitWidth { - NumberAnimation { - duration: Bar.workspaceAnimationDuration - easing.type: Easing.InOutQuad - } - } + Behavior on implicitWidth { + NumberAnimation { + duration: Bar.workspaceAnimationDuration + easing.type: Easing.InOutQuad + } + } } RowLayout { @@ -149,14 +149,15 @@ Item { // } onExited: { root.toChild = false; - if (!active && previousActiveIndex >= 0) { - // just in case - activeRect.x = layout.x + previousActiveIndex * Bar.workspaceIconSize + previousActiveIndex * Bar.workspaceSpacing; - activeRect.implicitWidth = Bar.workspaceActiveIconSize; - // root.activeOccupied = parent.st.isOccupied || false; - root.activeOccupied = getWorkspaceStats(previousActiveIndex).isOccupied || false; - previousActiveIndex = -1; - } + // outer MouseArea will handle this + // if (!active && previousActiveIndex >= 0) { + // // just in case + // activeRect.x = layout.x + previousActiveIndex * Bar.workspaceIconSize + previousActiveIndex * Bar.workspaceSpacing; + // activeRect.implicitWidth = Bar.workspaceActiveIconSize; + // // root.activeOccupied = parent.st.isOccupied || false; + // root.activeOccupied = getWorkspaceStats(previousActiveIndex).isOccupied || false; + // previousActiveIndex = -1; + // } } onWheel: event => { // no idea wats wrong w/ prev so we just unify it to use +/- 1 -- cgit v1.2.3