fix binding loops for ShortcutBadges

pull/4/head
Michail Vourlakos 6 years ago
parent f6d2e8c8f8
commit 58d8208704

@ -25,7 +25,10 @@ import org.kde.latte 0.2 as Latte
Loader{
id: appletNumberLoader
active: isValidDelayer > 0
active: appletItem.canShowAppletNumberBadge &&
((root.showAppletsNumbers && root.unifiedGlobalShortcuts)
|| (root.showMetaBadge && applet.id===applicationLauncherId))
asynchronous: true
visible: badgeString!==""
@ -40,14 +43,6 @@ Loader{
Component.onCompleted: fixedIndex = parabolicManager.pseudoAppletIndex(index);
property real isValidDelayer: appletItem.canShowAppletNumberBadge &&
((root.showAppletsNumbers && root.unifiedGlobalShortcuts)
|| (root.showMetaBadge && applet.id===applicationLauncherId)) ? 1 : 0
Behavior on isValidDelayer {
NumberAnimation { duration: root.durationTime*units.longDuration }
}
Binding{
target: appletNumberLoader
property:"badgeString"

@ -573,7 +573,7 @@ Item{
Loader{
id: taskNumberLoader
anchors.fill: iconImageBuffer
active: isValidDelayer>0 && !launcherAnimation.running
active: root.showTasksNumbers && !taskItem.isSeparator && fixedIndex>=0 && fixedIndex<20
asynchronous: true
visible: badgeString !== ""
@ -581,20 +581,13 @@ Item{
property string badgeString: (taskNumberLoader.fixedIndex>=1 && taskNumberLoader.fixedIndex<20 && root.badgesForActivate.length===19) ?
root.badgesForActivate[taskNumberLoader.fixedIndex-1] : ""
onActiveChanged: {
if (active) {
fixedIndex = parabolicManager.pseudoTaskIndex(index+1);
}
Connections {
target: root
onShowTasksNumbersChanged: taskNumberLoader.fixedIndex = parabolicManager.pseudoTaskIndex(index+1);
}
Component.onCompleted: fixedIndex = parabolicManager.pseudoTaskIndex(index+1);
property real isValidDelayer: root.showTasksNumbers && !taskItem.isSeparator && fixedIndex<20 ? 1 : 0
Behavior on isValidDelayer {
NumberAnimation { duration: root.durationTime*units.longDuration }
}
sourceComponent: Item{
Loader{
anchors.fill: taskNumber

Loading…
Cancel
Save