From 7db40ffdfb962c27a25b13b1b7ef901362c5bba1 Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Mon, 20 Oct 2025 22:11:48 +0800 Subject: [PATCH 1/7] MediaMini: fix incontinous title scrolling when media isn't playing --- 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..7808bace 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -263,7 +263,7 @@ Item { property bool isResetting: false property real textWidth: fullTitleMetrics.contentWidth property real containerWidth: 0 - property bool needsScrolling: textWidth > containerWidth && MediaService.isPlaying + property bool needsScrolling: textWidth > containerWidth // Timer for "always" mode with delay Timer { From 2f7217125c2144f2116345baffae6488627e6889 Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Mon, 20 Oct 2025 23:45:02 +0800 Subject: [PATCH 2/7] MediaMini: fix inconsistent scrolling behavior on different scaling --- Modules/Bar/Widgets/MediaMini.qml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index 7808bace..87a99654 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -95,14 +95,16 @@ Item { contentWidth += 21 * scaling } - // Spacing between icon/art and text - contentWidth += Style.marginS * scaling + // Spacing between icon/art and text; only if there is text + if (fullTitleMetrics.contentWidth > 0) { + contentWidth += Style.marginS * scaling - // Text width (use the measured width) - contentWidth += fullTitleMetrics.contentWidth + // Text width (use the measured width) + contentWidth += fullTitleMetrics.contentWidth - // Additional small margin for text - contentWidth += Style.marginXXS * 2 + // Additional small margin for text + contentWidth += Style.marginXXS * 2 + } // Add container margins contentWidth += margins @@ -248,7 +250,7 @@ Item { Layout.preferredWidth: { // Calculate available width based on other elements in the row var iconWidth = (windowIcon.visible ? (Style.fontSizeL + Style.marginS) : 0) - var albumArtWidth = (hasActivePlayer && showAlbumArt ? (18 + Style.marginS) : 0) + var albumArtWidth = (hasActivePlayer && showAlbumArt ? (18 * scaling + Style.marginS) : 0) var totalMargins = Style.marginXXS * 2 var availableWidth = mainContainer.width - iconWidth - albumArtWidth - totalMargins return Math.max(20, availableWidth) From 25ffb6c389906363ec1ad570b3f19b0dc7def63b Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Mon, 20 Oct 2025 23:45:53 +0800 Subject: [PATCH 3/7] MediaMini: sychronize title width animation with widget width --- Modules/Bar/Widgets/MediaMini.qml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index 87a99654..840ac754 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -385,13 +385,6 @@ Item { easing.type: Easing.Linear } } - - Behavior on Layout.preferredWidth { - NumberAnimation { - duration: Style.animationSlow - easing.type: Easing.InOutCubic - } - } } } From 593707baa48278f2e1f1e5e1de3d0248faf69522 Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Tue, 21 Oct 2025 12:24:55 +0800 Subject: [PATCH 4/7] MediaMini: prevent initial width jump to maxWidth when widget appears --- Modules/Bar/Widgets/MediaMini.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index 840ac754..7979f025 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -120,7 +120,8 @@ Item { } // Otherwise, adapt to content if (!hasActivePlayer) { - return maxWidth + // Keep compact when no active player + return calculateContentWidth() } // Use content width but don't exceed user-set maximum width return Math.min(calculateContentWidth(), maxWidth) From 6d95ab464ef25aab8bf4e1d9052ccc2e129adcc0 Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Tue, 21 Oct 2025 18:44:28 +0800 Subject: [PATCH 5/7] MediaMini: fix insufficient width that triggered scrolling when no active player --- Modules/Bar/Widgets/MediaMini.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index 7979f025..c988b01a 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -89,7 +89,7 @@ Item { // Icon or album art width if (!hasActivePlayer || !showAlbumArt) { // Icon width - contentWidth += Style.fontSizeL * scaling + contentWidth += Math.round(18 * scaling) } else if (showAlbumArt && hasActivePlayer) { // Album art width contentWidth += 21 * scaling @@ -250,8 +250,8 @@ Item { id: titleContainer Layout.preferredWidth: { // Calculate available width based on other elements in the row - var iconWidth = (windowIcon.visible ? (Style.fontSizeL + Style.marginS) : 0) - var albumArtWidth = (hasActivePlayer && showAlbumArt ? (18 * scaling + Style.marginS) : 0) + var iconWidth = (windowIcon.visible ? (18 * scaling + Style.marginS * scaling) : 0) + var albumArtWidth = (hasActivePlayer && showAlbumArt ? (21 * scaling + Style.marginS * scaling) : 0) var totalMargins = Style.marginXXS * 2 var availableWidth = mainContainer.width - iconWidth - albumArtWidth - totalMargins return Math.max(20, availableWidth) From 5f369431846d97313f583302dd87c09df5622682 Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Tue, 21 Oct 2025 18:46:32 +0800 Subject: [PATCH 6/7] MediaMini: improve title scorlling behavior --- Modules/Bar/Widgets/MediaMini.qml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index c988b01a..0e2c6896 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -350,6 +350,14 @@ Item { verticalAlignment: Text.AlignVCenter horizontalAlignment: hasActivePlayer ? Text.AlignLeft : Text.AlignHCenter color: hasActivePlayer ? Color.mOnSurface : Color.mOnSurfaceVariant + onTextChanged: { + titleContainer.isScrolling = false + titleContainer.isResetting = false + scrollContainer.scrollX = 0 + if (needsScrolling) { + scrollStartTimer.restart() + } + } } NText { From 17cca538be898074727b8ba8227aa41855064637 Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Tue, 21 Oct 2025 18:47:09 +0800 Subject: [PATCH 7/7] MediaMini: add fade-in/out animation --- Modules/Bar/Widgets/MediaMini.qml | 36 +++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index 0e2c6896..b1d6529f 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -60,16 +60,29 @@ Item { return title } - implicitHeight: visible ? (isVerticalBar ? calculatedVerticalDimension() : Style.barHeight) : 0 - implicitWidth: visible ? (isVerticalBar ? calculatedVerticalDimension() : dynamicWidth) : 0 + implicitHeight: visible ? (isVerticalBar ? (((!hasActivePlayer) && (hideMode === "hidden" || hideMode === "transparent")) ? 0 : calculatedVerticalDimension()) : Style.capsuleHeight) : 0 + implicitWidth: visible ? (isVerticalBar ? (((!hasActivePlayer) && (hideMode === "hidden" || hideMode === "transparent")) ? 0 : calculatedVerticalDimension()) : (((!hasActivePlayer) && (hideMode === "hidden" || hideMode === "transparent")) ? 0 : dynamicWidth)) : 0 // "visible": Always Visible, "hidden": Hide When Empty, "transparent": Transparent When Empty - visible: hideMode !== "hidden" || hasActivePlayer - opacity: hideMode !== "transparent" || hasActivePlayer ? 1.0 : 0 + visible: hideMode !== "hidden" || opacity > 0 + opacity: ((hideMode !== "hidden" || hasActivePlayer) && (hideMode !== "transparent" || hasActivePlayer)) ? 1.0 : 0.0 Behavior on opacity { NumberAnimation { duration: Style.animationNormal - easing.type: Easing.OutCubic + easing.type: Easing.InOutCubic + } + } + + Behavior on implicitWidth { + NumberAnimation { + duration: Style.animationNormal + easing.type: Easing.InOutCubic + } + } + Behavior on implicitHeight { + NumberAnimation { + duration: Style.animationNormal + easing.type: Easing.InOutCubic } } @@ -142,8 +155,8 @@ Item { visible: root.visible anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter - width: isVerticalBar ? root.width : dynamicWidth - height: isVerticalBar ? width : Style.capsuleHeight + width: isVerticalBar ? (((!hasActivePlayer) && (hideMode === "hidden" || hideMode === "transparent")) ? 0 : calculatedVerticalDimension()) : (((!hasActivePlayer) && (hideMode === "hidden" || hideMode === "transparent")) ? 0 : dynamicWidth) + height: isVerticalBar ? (((!hasActivePlayer) && (hideMode === "hidden" || hideMode === "transparent")) ? 0 : calculatedVerticalDimension()) : Style.capsuleHeight radius: isVerticalBar ? width / 2 : Style.radiusM color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent @@ -155,11 +168,20 @@ Item { } } + // Smooth height transition for vertical bar + Behavior on height { + NumberAnimation { + duration: Style.animationNormal + easing.type: Easing.InOutCubic + } + } + Item { id: mainContainer anchors.fill: parent anchors.leftMargin: isVerticalBar ? 0 : Style.marginS * scaling anchors.rightMargin: isVerticalBar ? 0 : Style.marginS * scaling + clip: true Loader { anchors.verticalCenter: parent.verticalCenter