This commit is contained in:
2025-11-13 19:27:11 -06:00
parent 184e939bb6
commit e1e1b316cf
11 changed files with 513 additions and 108 deletions

View File

@@ -6,17 +6,20 @@ import Quickshell.Widgets
Item {
id: media
width: 250 > 9 * button.text.length ? 250 : 9 * button.text.length
height: 30
readonly property real textWidth: info.contentWidth + 10
ClippingWrapperRectangle {
radius: 5
anchors.fill: parent
Button {
Text {
id: button
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
id: info
property real offset: 0
text: {
let s = ''
let players = []
@@ -35,37 +38,11 @@ Item {
s += ' - ' + players[0].trackArtist
}
let a = offset % s.length
let b = (offset + s.length - 1) % s.length
media.visible = players.length > 0
if(s == '')
media.visible = false
else
media.visible = true
if(b < a) {
return s.substring(a, s.length) + ' ' + s.substring(0, b)
} else {
return s.substring(a, b) + ' '
}
//return s
return s
}
font.pointSize: 11
onClicked: {
timer.running = !timer.running
}
Timer {
id: timer
interval: 225
running: true
repeat: true
onTriggered: button.offset = (button.offset + 1) % (2 * button.text.length)
}
}
}
}