show timestamp
This commit is contained in:
parent
8ee0f00ce5
commit
2915a5fc3a
1 changed files with 11 additions and 13 deletions
|
|
@ -23,19 +23,6 @@ WrapperRectangle {
|
||||||
|
|
||||||
implicitWidth: 800
|
implicitWidth: 800
|
||||||
|
|
||||||
StyledText {
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
text: {
|
|
||||||
if (root.player.identity) {
|
|
||||||
const words = root.player.identity.split("-");
|
|
||||||
const capitalized = words.map(val => String(val).charAt(0).toUpperCase() + String(val).slice(1));
|
|
||||||
return capitalized.join(" ");
|
|
||||||
}
|
|
||||||
return root.player.desktopEntry ?? root.player.dbusName ?? "unknown";
|
|
||||||
}
|
|
||||||
font.pixelSize: 20
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
id: text
|
id: text
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
@ -77,6 +64,17 @@ WrapperRectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
text: {
|
||||||
|
function formatTime(num) {
|
||||||
|
return Math.floor(num).toString().padStart(2, "0");
|
||||||
|
}
|
||||||
|
return `${formatTime(root.player.position / 60)}:${formatTime(root.player.position % 60)} - ${formatTime(root.player.length / 60)}:${formatTime(root.player.length % 60)}`;
|
||||||
|
}
|
||||||
|
font.pixelSize: Dimensions.mpris.fontSize
|
||||||
|
}
|
||||||
|
|
||||||
StyledSlider {
|
StyledSlider {
|
||||||
from: 0
|
from: 0
|
||||||
to: root.player.length ?? 0
|
to: root.player.length ?? 0
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue