[applets/systemtray] Fix highlight on applet pin

Sometimes parent component on the applet is not fully updated - for
example effectiveStatus is not yet read from the model. In such case it
will have default value leading to undesired effect.

Call all `updateHighlightedItem` in `Qt.callLater` so that it is called
in next event loop. As a bonus it is called only once, which can improve
performance.

BUG: 437105
FIXED-IN: 5.22.0


(cherry picked from commit 07b3b10de7)
wilder-5.22
Konrad Materka 5 years ago committed by Nate Graham
parent 6e7ddbfed4
commit 1ce09dcfcb
  1. 12
      applets/systemtray/package/contents/ui/CurrentItemHighLight.qml

@ -59,11 +59,11 @@ PlasmaCore.FrameSvgItem {
target: systemTrayState
function onActiveAppletChanged() {
updateHighlightedItem();
Qt.callLater(updateHighlightedItem);
}
function onExpandedChanged() {
updateHighlightedItem();
Qt.callLater(updateHighlightedItem);
}
}
@ -72,7 +72,7 @@ PlasmaCore.FrameSvgItem {
target: systemTrayState.activeApplet
function onParentChanged() {
updateHighlightedItem();
Qt.callLater(updateHighlightedItem);
}
}
@ -81,11 +81,11 @@ PlasmaCore.FrameSvgItem {
target: parent
function onWidthChanged() {
updateHighlightedItem();
Qt.callLater(updateHighlightedItem);
}
function onHeightChanged() {
updateHighlightedItem();
Qt.callLater(updateHighlightedItem);
}
}
@ -94,7 +94,7 @@ PlasmaCore.FrameSvgItem {
target: !!highlightedItem && highlightedItem.parent ? highlightedItem.parent : null
function onScaleChanged() {
updateHighlightedItem();
Qt.callLater(updateHighlightedItem);
}
}

Loading…
Cancel
Save