1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-27 14:50:21 +03:00

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
This commit is contained in:
Michail Vourlakos 2018-11-24 19:24:52 +02:00
parent 7e43fafd19
commit ba76515c83
2 changed files with 30 additions and 12 deletions

View File

@ -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();
}
}

View File

@ -261,6 +261,10 @@ Item{
}
function updateLayoutHeight(){
if (container.needsFillSpace && root.isVertical) {
layoutsContainer.updateSizeForAppletsInFill();
return;
}
if(container.isInternalViewSplitter){
if(!root.editMode)
@ -307,6 +311,10 @@ Item{
}
function updateLayoutWidth(){
if (needsFillSpace && root.isHorizontal) {
layoutsContainer.updateSizeForAppletsInFill();
return;
}
if(container.isInternalViewSplitter){
if(!root.editMode)