MediaMini: fix binding loop + edge case where no icon would appear. Also set Autohide to false by default for ActiveWindow and MediaMini

This commit is contained in:
ItsLemmy
2025-09-30 17:56:59 -04:00
parent f49462f999
commit 6f4aa1a1a1
2 changed files with 15 additions and 6 deletions
+13 -4
View File
@@ -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
+2 -2
View File
@@ -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,