From 6f4aa1a1a1f839d7ad6e3513ea0d395aa9a2b967 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Tue, 30 Sep 2025 17:56:59 -0400 Subject: [PATCH] MediaMini: fix binding loop + edge case where no icon would appear. Also set Autohide to false by default for ActiveWindow and MediaMini --- Modules/Bar/Widgets/MediaMini.qml | 17 +++++++++++++---- Services/BarWidgetRegistry.qml | 4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index c9c11b3d..0f96cb9a 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -160,10 +160,11 @@ Item { NIcon { id: windowIcon icon: hasActivePlayer ? (MediaService.isPlaying ? "media-pause" : "media-play") : "disc" + color: hasActivePlayer ? Color.mOnSurface : Color.mOnSurfaceVariant pointSize: Style.fontSizeL * scaling verticalAlignment: Text.AlignVCenter Layout.alignment: Qt.AlignVCenter - visible: !showAlbumArt && !trackArt.visible + visible: !hasActivePlayer || (!showAlbumArt && !trackArt.visible) } ColumnLayout { @@ -210,7 +211,7 @@ Item { property bool isScrolling: false property bool isResetting: false property real textWidth: fullTitleMetrics.contentWidth - property real containerWidth: width + property real containerWidth: 0 property bool needsScrolling: textWidth > containerWidth // Timer for "always" mode with delay @@ -257,8 +258,15 @@ Item { } } - onWidthChanged: updateScrollingState() - Component.onCompleted: updateScrollingState() + onWidthChanged: { + containerWidth = width + updateScrollingState() + } + + Component.onCompleted: { + containerWidth = width + updateScrollingState() + } Connections { target: mouseArea @@ -350,6 +358,7 @@ Item { id: mediaIconVertical anchors.fill: parent icon: hasActivePlayer ? (MediaService.isPlaying ? "media-pause" : "media-play") : "disc" + color: hasActivePlayer ? Color.mOnSurface : Color.mOnSurfaceVariant pointSize: Style.fontSizeL * scaling verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter diff --git a/Services/BarWidgetRegistry.qml b/Services/BarWidgetRegistry.qml index 6beda333..b1d528ea 100644 --- a/Services/BarWidgetRegistry.qml +++ b/Services/BarWidgetRegistry.qml @@ -41,7 +41,7 @@ Singleton { "ActiveWindow": { "allowUserSettings": true, "showIcon": true, - "autoHide": true, + "autoHide": false, "scrollingMode": "hover" }, "Battery": { @@ -81,7 +81,7 @@ Singleton { }, "MediaMini": { "allowUserSettings": true, - "autoHide": true, + "autoHide": false, "scrollingMode": "hover", "showAlbumArt": false, "showVisualizer": false,