From 9e39867117fc59e4604b11c912ffadf62f85177e Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Sun, 19 Oct 2025 11:24:25 +0800 Subject: [PATCH 1/6] ActiveWindow: synchronize title width with widget width --- Modules/Bar/Widgets/ActiveWindow.qml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Modules/Bar/Widgets/ActiveWindow.qml b/Modules/Bar/Widgets/ActiveWindow.qml index 2058bf1a..04e9a0ab 100644 --- a/Modules/Bar/Widgets/ActiveWindow.qml +++ b/Modules/Bar/Widgets/ActiveWindow.qml @@ -343,13 +343,6 @@ Item { easing.type: Easing.Linear } } - - Behavior on Layout.preferredWidth { - NumberAnimation { - duration: Style.animationSlow - easing.type: Easing.InOutCubic - } - } } } From 70153217727fbd847b1d4c1c8b4d5b66acacaa17 Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Sun, 19 Oct 2025 11:28:42 +0800 Subject: [PATCH 2/6] ActiveWindow: reset scrolling when focused window changes --- Modules/Bar/Widgets/ActiveWindow.qml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Modules/Bar/Widgets/ActiveWindow.qml b/Modules/Bar/Widgets/ActiveWindow.qml index 04e9a0ab..b951e958 100644 --- a/Modules/Bar/Widgets/ActiveWindow.qml +++ b/Modules/Bar/Widgets/ActiveWindow.qml @@ -307,6 +307,14 @@ Item { font.weight: Style.fontWeightMedium verticalAlignment: Text.AlignVCenter color: Color.mOnSurface + onTextChanged: { + if (root.scrollingMode === "always") { + titleContainer.isScrolling = false + titleContainer.isResetting = false + scrollContainer.scrollX = 0 + scrollStartTimer.restart() + } + } } // Second copy for seamless scrolling From 7f5fd5fa14ac2269db178a4f3bd65a97f5caf1aa Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Sun, 19 Oct 2025 12:09:39 +0800 Subject: [PATCH 3/6] ActiveWindow: add fade-in and fade-out transitions of widget --- Modules/Bar/Widgets/ActiveWindow.qml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Modules/Bar/Widgets/ActiveWindow.qml b/Modules/Bar/Widgets/ActiveWindow.qml index b951e958..47041393 100644 --- a/Modules/Bar/Widgets/ActiveWindow.qml +++ b/Modules/Bar/Widgets/ActiveWindow.qml @@ -45,12 +45,12 @@ Item { readonly property string windowTitle: CompositorService.getFocusedWindowTitle() || "No active window" readonly property string fallbackIcon: "user-desktop" - implicitHeight: visible ? (isVerticalBar ? calculatedVerticalDimension() : Style.barHeight) : 0 - implicitWidth: visible ? (isVerticalBar ? calculatedVerticalDimension() : dynamicWidth) : 0 + implicitHeight: visible ? (isVerticalBar ? calculatedVerticalDimension() : Style.capsuleHeight) : 0 + implicitWidth: visible ? (isVerticalBar ? calculatedVerticalDimension() : (((!hasFocusedWindow) && (hideMode === "transparent" || hideMode === "hidden")) ? 0 : dynamicWidth)) : 0 // "visible": Always Visible, "hidden": Hide When Empty, "transparent": Transparent When Empty - visible: hideMode !== "hidden" || hasFocusedWindow - opacity: hideMode !== "transparent" || hasFocusedWindow ? 1.0 : 0 + visible: (hideMode !== "hidden" || hasFocusedWindow) || opacity > 0 + opacity: ((hideMode !== "hidden" || hasFocusedWindow) && (hideMode !== "transparent" || hasFocusedWindow)) ? 1.0 : 0.0 Behavior on opacity { NumberAnimation { duration: Style.animationNormal @@ -58,6 +58,20 @@ Item { } } + Behavior on implicitWidth { + NumberAnimation { + duration: Style.animationNormal + easing.type: Easing.InOutCubic + } + } + + Behavior on implicitHeight { + NumberAnimation { + duration: Style.animationNormal + easing.type: Easing.InOutCubic + } + } + function calculatedVerticalDimension() { return Math.round((Style.baseWidgetSize - 5) * scaling) } @@ -157,7 +171,7 @@ Item { visible: root.visible anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter - width: isVerticalBar ? root.width : dynamicWidth + width: isVerticalBar ? root.width : (((!hasFocusedWindow) && (hideMode === "transparent" || hideMode === "hidden")) ? 0 : dynamicWidth) height: isVerticalBar ? width : Style.capsuleHeight radius: isVerticalBar ? width / 2 : Style.radiusM color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent From 5e562bb9a92cdc120da006d736724122ccff5cad Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Sun, 19 Oct 2025 13:14:02 +0800 Subject: [PATCH 4/6] ActiveWindow: fix widget width still remains on maxWidth when visiblity is Always Visible --- Modules/Bar/Widgets/ActiveWindow.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Bar/Widgets/ActiveWindow.qml b/Modules/Bar/Widgets/ActiveWindow.qml index 47041393..a3c76f29 100644 --- a/Modules/Bar/Widgets/ActiveWindow.qml +++ b/Modules/Bar/Widgets/ActiveWindow.qml @@ -46,7 +46,7 @@ Item { readonly property string fallbackIcon: "user-desktop" implicitHeight: visible ? (isVerticalBar ? calculatedVerticalDimension() : Style.capsuleHeight) : 0 - implicitWidth: visible ? (isVerticalBar ? calculatedVerticalDimension() : (((!hasFocusedWindow) && (hideMode === "transparent" || hideMode === "hidden")) ? 0 : dynamicWidth)) : 0 + implicitWidth: visible ? (isVerticalBar ? calculatedVerticalDimension() : (((!hasFocusedWindow) && hideMode === "hidden") ? 0 : dynamicWidth)) : 0 // "visible": Always Visible, "hidden": Hide When Empty, "transparent": Transparent When Empty visible: (hideMode !== "hidden" || hasFocusedWindow) || opacity > 0 @@ -107,7 +107,7 @@ Item { } // Otherwise, adapt to content if (!hasFocusedWindow) { - return maxWidth + return Math.min(calculateContentWidth(), maxWidth) } // Use content width but don't exceed user-set maximum width return Math.min(calculateContentWidth(), maxWidth) @@ -171,7 +171,7 @@ Item { visible: root.visible anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter - width: isVerticalBar ? root.width : (((!hasFocusedWindow) && (hideMode === "transparent" || hideMode === "hidden")) ? 0 : dynamicWidth) + width: isVerticalBar ? root.width : (((!hasFocusedWindow) && hideMode === "hidden") ? 0 : dynamicWidth) height: isVerticalBar ? width : Style.capsuleHeight radius: isVerticalBar ? width / 2 : Style.radiusM color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent From c56d1430e5daca27984524b5cf08725cb0786ff9 Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Sun, 19 Oct 2025 13:33:45 +0800 Subject: [PATCH 5/6] ActiveWindow: fix inconsistency of animation on vertical bar --- Modules/Bar/Widgets/ActiveWindow.qml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Modules/Bar/Widgets/ActiveWindow.qml b/Modules/Bar/Widgets/ActiveWindow.qml index a3c76f29..ae639ffb 100644 --- a/Modules/Bar/Widgets/ActiveWindow.qml +++ b/Modules/Bar/Widgets/ActiveWindow.qml @@ -45,8 +45,8 @@ Item { readonly property string windowTitle: CompositorService.getFocusedWindowTitle() || "No active window" readonly property string fallbackIcon: "user-desktop" - implicitHeight: visible ? (isVerticalBar ? calculatedVerticalDimension() : Style.capsuleHeight) : 0 - implicitWidth: visible ? (isVerticalBar ? calculatedVerticalDimension() : (((!hasFocusedWindow) && hideMode === "hidden") ? 0 : dynamicWidth)) : 0 + implicitHeight: visible ? (isVerticalBar ? (((!hasFocusedWindow) && hideMode === "hidden") ? 0 : calculatedVerticalDimension()) : Style.capsuleHeight) : 0 + implicitWidth: visible ? (isVerticalBar ? (((!hasFocusedWindow) && hideMode === "hidden") ? 0 : calculatedVerticalDimension()) : (((!hasFocusedWindow) && hideMode === "hidden") ? 0 : dynamicWidth)) : 0 // "visible": Always Visible, "hidden": Hide When Empty, "transparent": Transparent When Empty visible: (hideMode !== "hidden" || hasFocusedWindow) || opacity > 0 @@ -169,10 +169,9 @@ Item { Rectangle { id: windowActiveRect visible: root.visible - anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter - width: isVerticalBar ? root.width : (((!hasFocusedWindow) && hideMode === "hidden") ? 0 : dynamicWidth) - height: isVerticalBar ? width : Style.capsuleHeight + width: isVerticalBar ? ((!hasFocusedWindow) && hideMode === "hidden" ? 0 : calculatedVerticalDimension()) : ((!hasFocusedWindow) && (hideMode === "hidden") ? 0 : dynamicWidth) + height: isVerticalBar ? ((!hasFocusedWindow) && hideMode === "hidden" ? 0 : calculatedVerticalDimension()) : Style.capsuleHeight radius: isVerticalBar ? width / 2 : Style.radiusM color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent From 49fd63502e07cb6994402206ddcf1e67a2de4ec9 Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Tue, 21 Oct 2025 20:12:39 +0800 Subject: [PATCH 6/6] ActiveWindow: small improvement for fade-in --- Modules/Bar/Widgets/MediaMini.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index 9831626e..617b73d3 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -69,7 +69,7 @@ Item { Behavior on opacity { NumberAnimation { duration: Style.animationNormal - easing.type: Easing.OutCubic + easing.type: Easing.InOutCubic } }