ActiveWindow+MediaMini: minor adjustments to width and spacing.
- also removed double fallback icon for media mini when no artwork available
This commit is contained in:
parent
1ceec16102
commit
67f0c482b3
2 changed files with 8 additions and 17 deletions
|
|
@ -14,6 +14,7 @@ Row {
|
||||||
property real scaling: ScalingService.scale(screen)
|
property real scaling: ScalingService.scale(screen)
|
||||||
// Title stays collapsed by default; expands only on hover
|
// Title stays collapsed by default; expands only on hover
|
||||||
property bool showingFullTitle: false
|
property bool showingFullTitle: false
|
||||||
|
readonly property int minWidth: 120
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
spacing: Style.marginS * scaling
|
spacing: Style.marginS * scaling
|
||||||
|
|
@ -63,7 +64,7 @@ Row {
|
||||||
Row {
|
Row {
|
||||||
id: row
|
id: row
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
spacing: Style.marginXS * scaling
|
spacing: Style.marginS * scaling
|
||||||
|
|
||||||
// Window icon
|
// Window icon
|
||||||
Item {
|
Item {
|
||||||
|
|
@ -85,10 +86,10 @@ Row {
|
||||||
NText {
|
NText {
|
||||||
id: titleText
|
id: titleText
|
||||||
|
|
||||||
// Fix collapsed width to 150px to avoid layout shifts with neighbors
|
// Fix collapsed width to 120px to avoid layout shifts with neighbors
|
||||||
// Expand up to 400px on hover
|
// Expand up to 400px on hover
|
||||||
width: mouseArea.containsMouse ? Math.min(fullTitleMetrics.contentWidth, 400 * scaling) : 150 * scaling
|
width: mouseArea.containsMouse ? Math.min(Math.max(minWidth * scaling, fullTitleMetrics.contentWidth), 400 * scaling) : minWidth * scaling
|
||||||
horizontalAlignment: mouseArea.containsMouse ? Text.AlignLeft : Text.AlignHCenter
|
horizontalAlignment: Text.AlignLeft
|
||||||
text: getTitle()
|
text: getTitle()
|
||||||
font.pointSize: Style.fontSizeS * scaling
|
font.pointSize: Style.fontSizeS * scaling
|
||||||
font.weight: Style.fontWeightMedium
|
font.weight: Style.fontWeightMedium
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ Row {
|
||||||
Row {
|
Row {
|
||||||
id: row
|
id: row
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
spacing: Style.marginXS * scaling
|
spacing: Style.marginS * scaling
|
||||||
z: 1 // Above the visualizer
|
z: 1 // Above the visualizer
|
||||||
|
|
||||||
NIcon {
|
NIcon {
|
||||||
|
|
@ -132,16 +132,6 @@ Row {
|
||||||
borderWidth: 0
|
borderWidth: 0
|
||||||
border.color: Color.transparent
|
border.color: Color.transparent
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback icon when no album art available
|
|
||||||
NIcon {
|
|
||||||
id: windowIconFallback
|
|
||||||
text: MediaService.isPlaying ? "pause" : "play_arrow"
|
|
||||||
font.pointSize: Style.fontSizeL * scaling
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
visible: getTitle() !== "" && !trackArt.visible
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -149,10 +139,10 @@ Row {
|
||||||
id: titleText
|
id: titleText
|
||||||
|
|
||||||
// If hovered or just switched window, show up to 400 pixels
|
// If hovered or just switched window, show up to 400 pixels
|
||||||
// If not hovered show up to 150 pixels
|
// If not hovered show up to 120 pixels
|
||||||
width: (mouseArea.containsMouse) ? Math.min(fullTitleMetrics.contentWidth,
|
width: (mouseArea.containsMouse) ? Math.min(fullTitleMetrics.contentWidth,
|
||||||
400 * scaling) : Math.min(fullTitleMetrics.contentWidth,
|
400 * scaling) : Math.min(fullTitleMetrics.contentWidth,
|
||||||
150 * scaling)
|
120 * scaling)
|
||||||
text: getTitle()
|
text: getTitle()
|
||||||
font.pointSize: Style.fontSizeS * scaling
|
font.pointSize: Style.fontSizeS * scaling
|
||||||
font.weight: Style.fontWeightMedium
|
font.weight: Style.fontWeightMedium
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue