mirror of https://github.com/KDE/kasts.git
Make time countdown setting in player persistent
This commit is contained in:
parent
e1b374e375
commit
e174269332
|
@ -135,15 +135,17 @@ Kirigami.Page {
|
||||||
Layout.preferredWidth: endLabel.implicitWidth + Kirigami.Units.gridUnit
|
Layout.preferredWidth: endLabel.implicitWidth + Kirigami.Units.gridUnit
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
id: endLabel
|
id: endLabel
|
||||||
property int toggle: 0
|
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: (toggle === 0) ? ((Math.floor(audio.duration/3600000) < 10 ? "0" : "") + Math.floor(audio.duration/3600000) + ":" + (Math.floor(audio.duration/60000) % 60 < 10 ? "0" : "") + Math.floor(audio.duration/60000) % 60 + ":" + (Math.floor(audio.duration/1000) % 60 < 10 ? "0" : "") + Math.floor(audio.duration/1000) % 60) : ((Math.floor((audio.duration-audio.position)/3600000) < 10 ? "-0" : "-") + Math.floor((audio.duration-audio.position)/3600000) + ":" + (Math.floor((audio.duration-audio.position)/60000) % 60 < 10 ? "0" : "") + Math.floor((audio.duration-audio.position)/60000) % 60 + ":" + (Math.floor((audio.duration-audio.position)/1000) % 60 < 10 ? "0" : "") + Math.floor((audio.duration-audio.position)/1000) % 60)
|
text: (SettingsManager.showRemainingTime) ?
|
||||||
|
((Math.floor((audio.duration-audio.position)/3600000) < 10 ? "-0" : "-") + Math.floor((audio.duration-audio.position)/3600000) + ":" + (Math.floor((audio.duration-audio.position)/60000) % 60 < 10 ? "0" : "") + Math.floor((audio.duration-audio.position)/60000) % 60 + ":" + (Math.floor((audio.duration-audio.position)/1000) % 60 < 10 ? "0" : "") + Math.floor((audio.duration-audio.position)/1000) % 60)
|
||||||
|
: ((Math.floor(audio.duration/3600000) < 10 ? "0" : "") + Math.floor(audio.duration/3600000) + ":" + (Math.floor(audio.duration/60000) % 60 < 10 ? "0" : "") + Math.floor(audio.duration/60000) % 60 + ":" + (Math.floor(audio.duration/1000) % 60 < 10 ? "0" : "") + Math.floor(audio.duration/1000) % 60)
|
||||||
|
|
||||||
}
|
}
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onClicked: (endLabel.toggle === 0) ? endLabel.toggle=1 : endLabel.toggle=0
|
onClicked: SettingsManager.showRemainingTime = !SettingsManager.showRemainingTime
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,5 +47,9 @@
|
||||||
<label>The entry that was being played at shutdown</label>
|
<label>The entry that was being played at shutdown</label>
|
||||||
<default>none</default>
|
<default>none</default>
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry name="showRemainingTime" type="Bool">
|
||||||
|
<label>Whether the player shows remaining track time instead of total track time</label>
|
||||||
|
<default>false</default>
|
||||||
|
</entry>
|
||||||
</group>
|
</group>
|
||||||
</kcfg>
|
</kcfg>
|
||||||
|
|
Loading…
Reference in New Issue