update sizes for fillWidth/Height more regular

--this way applets wont stack up in a size that is not
following panel available size and applets Layout sizes
settings
pull/3/head
Michail Vourlakos 6 years ago
parent 174c092a58
commit 78543c84e3

@ -131,7 +131,7 @@ Item{
slotAnimationsNeedLength(1); slotAnimationsNeedLength(1);
} }
HeuristicTools.updateSizeForAppletsInFill(); layoutsContainer.updateSizeForAppletsInFill();
delayUpdateMaskArea.start(); delayUpdateMaskArea.start();
} }
@ -156,7 +156,7 @@ Item{
slotAnimationsNeedLength(1); slotAnimationsNeedLength(1);
} }
HeuristicTools.updateSizeForAppletsInFill(); layoutsContainer.updateSizeForAppletsInFill();
delayUpdateMaskArea.start(); delayUpdateMaskArea.start();
} }
@ -230,9 +230,9 @@ Item{
return no; return no;
} }
onFillAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); onFillAppletsChanged: layoutsContainer.updateSizeForAppletsInFill();
onShownAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); onShownAppletsChanged: layoutsContainer.updateSizeForAppletsInFill();
onSizeWithNoFillAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); onSizeWithNoFillAppletsChanged: layoutsContainer.updateSizeForAppletsInFill();
states:[ states:[
State { State {
@ -357,9 +357,9 @@ Item{
return no; return no;
} }
onFillAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); onFillAppletsChanged: layoutsContainer.updateSizeForAppletsInFill();
onShownAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); onShownAppletsChanged: layoutsContainer.updateSizeForAppletsInFill();
onSizeWithNoFillAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); onSizeWithNoFillAppletsChanged: layoutsContainer.updateSizeForAppletsInFill();
transitions: Transition { transitions: Transition {
enabled: editModeVisual.plasmaEditMode enabled: editModeVisual.plasmaEditMode
@ -623,9 +623,9 @@ Item{
return no; return no;
} }
onFillAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); onFillAppletsChanged: layoutsContainer.updateSizeForAppletsInFill();
onShownAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); onShownAppletsChanged: layoutsContainer.updateSizeForAppletsInFill();
onSizeWithNoFillAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); onSizeWithNoFillAppletsChanged: layoutsContainer.updateSizeForAppletsInFill();
states:[ states:[
State { State {
@ -685,6 +685,16 @@ Item{
function updateSizeForAppletsInFill() { 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();
} }
} }

@ -261,6 +261,10 @@ Item{
} }
function updateLayoutHeight(){ function updateLayoutHeight(){
if (container.needsFillSpace && root.isVertical) {
layoutsContainer.updateSizeForAppletsInFill();
return;
}
if (isLattePlasmoid) { if (isLattePlasmoid) {
return; return;
@ -309,6 +313,10 @@ Item{
} }
function updateLayoutWidth(){ function updateLayoutWidth(){
if (needsFillSpace && root.isHorizontal) {
layoutsContainer.updateSizeForAppletsInFill();
return;
}
if (isLattePlasmoid) { if (isLattePlasmoid) {
return; return;

Loading…
Cancel
Save