diff --git a/containment/package/contents/ui/LayoutsContainer.qml b/containment/package/contents/ui/LayoutsContainer.qml index 7cf692bfe..d3bcbd9fa 100644 --- a/containment/package/contents/ui/LayoutsContainer.qml +++ b/containment/package/contents/ui/LayoutsContainer.qml @@ -131,7 +131,7 @@ Item{ slotAnimationsNeedLength(1); } - HeuristicTools.updateSizeForAppletsInFill(); + layoutsContainer.updateSizeForAppletsInFill(); delayUpdateMaskArea.start(); } @@ -156,7 +156,7 @@ Item{ slotAnimationsNeedLength(1); } - HeuristicTools.updateSizeForAppletsInFill(); + layoutsContainer.updateSizeForAppletsInFill(); delayUpdateMaskArea.start(); } @@ -230,9 +230,9 @@ Item{ return no; } - onFillAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); - onShownAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); - onSizeWithNoFillAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); + onFillAppletsChanged: layoutsContainer.updateSizeForAppletsInFill(); + onShownAppletsChanged: layoutsContainer.updateSizeForAppletsInFill(); + onSizeWithNoFillAppletsChanged: layoutsContainer.updateSizeForAppletsInFill(); states:[ State { @@ -357,9 +357,9 @@ Item{ return no; } - onFillAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); - onShownAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); - onSizeWithNoFillAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); + onFillAppletsChanged: layoutsContainer.updateSizeForAppletsInFill(); + onShownAppletsChanged: layoutsContainer.updateSizeForAppletsInFill(); + onSizeWithNoFillAppletsChanged: layoutsContainer.updateSizeForAppletsInFill(); transitions: Transition { enabled: editModeVisual.plasmaEditMode @@ -623,9 +623,9 @@ Item{ return no; } - onFillAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); - onShownAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); - onSizeWithNoFillAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); + onFillAppletsChanged: layoutsContainer.updateSizeForAppletsInFill(); + onShownAppletsChanged: layoutsContainer.updateSizeForAppletsInFill(); + onSizeWithNoFillAppletsChanged: layoutsContainer.updateSizeForAppletsInFill(); states:[ State { @@ -685,6 +685,16 @@ Item{ function updateSizeForAppletsInFill() { - HeuristicTools.updateSizeForAppletsInFill(); + if (!updateSizeForAppletsInFillTimer.running) { + updateSizeForAppletsInFillTimer.start(); + } + } + + //! This timer is needed in order to reduce the calls to heavy cpu function + //! HeuristicTools.updateSizeForAppletsInFill() + Timer{ + id: updateSizeForAppletsInFillTimer + interval: 250 + onTriggered: HeuristicTools.updateSizeForAppletsInFill(); } } diff --git a/containment/package/contents/ui/applet/AppletItemWrapper.qml b/containment/package/contents/ui/applet/AppletItemWrapper.qml index 66ded9beb..579f0ed64 100644 --- a/containment/package/contents/ui/applet/AppletItemWrapper.qml +++ b/containment/package/contents/ui/applet/AppletItemWrapper.qml @@ -261,6 +261,10 @@ Item{ } function updateLayoutHeight(){ + if (container.needsFillSpace && root.isVertical) { + layoutsContainer.updateSizeForAppletsInFill(); + return; + } if (isLattePlasmoid) { return; @@ -309,6 +313,10 @@ Item{ } function updateLayoutWidth(){ + if (needsFillSpace && root.isHorizontal) { + layoutsContainer.updateSizeForAppletsInFill(); + return; + } if (isLattePlasmoid) { return;