mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
components/mobileshell: Don't tie MarqueeLabel durations to kirigami duration lengths
Otherwise setting the animation speed will affect the MarqueeLabel speed, which will look very glitched if it's fast.
This commit is contained in:
parent
7df864904a
commit
264197b7c6
1 changed files with 5 additions and 3 deletions
|
|
@ -16,7 +16,9 @@ PlasmaComponents.Label {
|
|||
required property string inputText
|
||||
readonly property string filteredText: inputText.replace(/\n/g, ' ') // remove new line characters
|
||||
|
||||
property int interval: Kirigami.Units.longDuration
|
||||
readonly property int interval: 200 // update position every 200 ms
|
||||
readonly property int longDuration: 300
|
||||
readonly property int waitDuration: 900
|
||||
|
||||
readonly property int charactersOverflow: Math.ceil((txtMeter.advanceWidth - root.width) / (txtMeter.advanceWidth / filteredText.length))
|
||||
property int step: 0
|
||||
|
|
@ -36,7 +38,7 @@ PlasmaComponents.Label {
|
|||
onTriggered: {
|
||||
if (paused) {
|
||||
if (step != 0) {
|
||||
interval = Kirigami.Units.veryLongDuration;
|
||||
interval = root.longDuration;
|
||||
step = 0;
|
||||
} else {
|
||||
interval = root.interval;
|
||||
|
|
@ -45,7 +47,7 @@ PlasmaComponents.Label {
|
|||
} else {
|
||||
step = (step + 1) % filteredText.length;
|
||||
if (step === charactersOverflow) {
|
||||
interval = Kirigami.Units.veryLongDuration * 3;
|
||||
interval = root.waitDuration;
|
||||
paused = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue