Skip to content

Commit

Permalink
fix: song text overflows when splitted in 2 lines
Browse files Browse the repository at this point in the history
Bug introduced in 90c683f
  • Loading branch information
ccatterina committed Nov 17, 2024
1 parent de571f8 commit c7627dc
Showing 1 changed file with 27 additions and 22 deletions.
49 changes: 27 additions & 22 deletions src/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ PlasmoidItem {
implicitHeight: horizontal ? column.implicitHeight : column.implicitWidth
Layout.fillHeight: horizontal || plasmoid.configuration.fillAvailableSpace
Layout.fillWidth: !horizontal || plasmoid.configuration.fillAvailableSpace
Layout.alignment : Qt.AlignVCenter | Qt.AlignHCenter
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.rightMargin: horizontal ? Kirigami.Units.smallSpacing : 0
Layout.leftMargin: horizontal ? Kirigami.Units.smallSpacing : 0
Layout.topMargin: horizontal ? 0 : Kirigami.Units.smallSpacing
Expand Down Expand Up @@ -250,27 +250,32 @@ PlasmoidItem {
}
]

ScrollingText {
visible: plasmoid.configuration.separateText
overflowBehaviour: plasmoid.configuration.textScrollingBehaviour
font: widget.boldTextFont
speed: plasmoid.configuration.textScrollingSpeed
maxWidth: plasmoid.configuration.fillAvailableSpace ? panelScrollingText.length : plasmoid.configuration.maxSongWidthInPanel
text: player.title
scrollingEnabled: textScrollingEnabled
scrollResetOnPause: textScrollingResetOnPause
textColor: foregroundColor
}
ScrollingText {
overflowBehaviour: plasmoid.configuration.textScrollingBehaviour
font: widget.textFont
speed: plasmoid.configuration.textScrollingSpeed
maxWidth: plasmoid.configuration.fillAvailableSpace ? panelScrollingText.length : plasmoid.configuration.maxSongWidthInPanel
text: plasmoid.configuration.separateText ? player.artists : [player.artists, player.title].filter((x) => x).join(" - ")
scrollingEnabled: textScrollingEnabled
scrollResetOnPause: textScrollingResetOnPause
visible: text.length !== 0
textColor: foregroundColor
ColumnLayout {
spacing: 0
anchors.centerIn: parent

ScrollingText {
visible: plasmoid.configuration.separateText
overflowBehaviour: plasmoid.configuration.textScrollingBehaviour
font: widget.boldTextFont
speed: plasmoid.configuration.textScrollingSpeed
maxWidth: plasmoid.configuration.fillAvailableSpace ? panelScrollingText.length : plasmoid.configuration.maxSongWidthInPanel
text: player.title
scrollingEnabled: textScrollingEnabled
scrollResetOnPause: textScrollingResetOnPause
textColor: foregroundColor
}
ScrollingText {
overflowBehaviour: plasmoid.configuration.textScrollingBehaviour
font: widget.textFont
speed: plasmoid.configuration.textScrollingSpeed
maxWidth: plasmoid.configuration.fillAvailableSpace ? panelScrollingText.length : plasmoid.configuration.maxSongWidthInPanel
text: plasmoid.configuration.separateText ? player.artists : [player.artists, player.title].filter((x) => x).join(" - ")
scrollingEnabled: textScrollingEnabled
scrollResetOnPause: textScrollingResetOnPause
visible: text.length !== 0
textColor: foregroundColor
}
}
}
}
Expand Down

0 comments on commit c7627dc

Please sign in to comment.