1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-25 19:21:41 +03:00

block calculations for applets changing parents

This commit is contained in:
Michail Vourlakos 2020-05-08 22:20:13 +03:00
parent 97a1c3fdb8
commit 6ae3c499f0
6 changed files with 28 additions and 18 deletions

View File

@ -29,11 +29,14 @@ ContainerAbility.Animations {
property Item metrics: null
property QtObject settings: null
//TO BE MOVED in LAYOUTER ability
property bool appletsInParentChange: false
readonly property bool inNormalFillCalculationsState: needBothAxis.count === 0
&& needThickness.count === 0
&& ((needLength.count === 0)
|| (needLength.count===1 && editModeVisual.inEditMode))
&& (!dragOverlay || (dragOverlay && !dragOverlay.pressed)) /*do not update during moving/dragging applets*/
&& !appletsInParentChange
//! Public Properties
active: plasmoid.configuration.animationsEnabled && LatteCore.WindowSystem.compositingActive

View File

@ -24,7 +24,8 @@ import "./privates" as Ability
Ability.IndexerPrivate {
//! do not update during dragging/moving applets inConfigureAppletsMode
updateIsBlocked: root.dragOverlay && root.dragOverlay.pressed
updateIsBlocked: (root.dragOverlay && root.dragOverlay.pressed)
|| animations.appletsInParentChange
function getClientBridge(index) {
if (clientsBridges.length<=0) {

View File

@ -36,8 +36,8 @@ AbilityDefinition.Indexer {
target: indxr
property: "separators"
value: {
if (index.updateIsBlocked) {
return;
if (updateIsBlocked) {
return [];
}
var seps = [];
@ -74,8 +74,8 @@ AbilityDefinition.Indexer {
target: indxr
property: "hidden"
value: {
if (index.updateIsBlocked) {
return;
if (updateIsBlocked) {
return [];
}
var hdn = [];
@ -112,8 +112,8 @@ AbilityDefinition.Indexer {
target: indxr
property: "clients"
value: {
if (index.updateIsBlocked) {
return;
if (updateIsBlocked) {
return [];
}
var clns = [];
@ -159,8 +159,8 @@ AbilityDefinition.Indexer {
target: indxr
property: "clientsBridges"
value: {
if (index.updateIsBlocked) {
return;
if (updateIsBlocked) {
return [];
}
var bdgs = [];

View File

@ -55,7 +55,8 @@ Abilities.AbilityGrid {
property int lastVisibleIndex: -1
//! do not update during dragging/moving applets inConfigureAppletsMode
readonly property bool updateIsBlocked: root.dragOverlay && root.dragOverlay.pressed
readonly property bool updateIsBlocked: (root.dragOverlay && root.dragOverlay.pressed)
|| animations.appletsInParentChange
Binding{
target: appletsContainer

View File

@ -28,7 +28,7 @@ AbilityGridPrivate {
readonly property bool updateIsBlocked: root.dragOverlay && root.dragOverlay.pressed
Binding{
target: ability.require
target: ability.parabolic
property: "restoreZoomIsBlocked"
value: {
if (grid.updateIsBlocked) {

View File

@ -527,12 +527,6 @@ Item {
}
onInConfigureAppletsModeChanged: {
/* if (inConfigureAppletsMode && panelUserSetAlignment===LatteCore.Types.Justify) {
joinLayoutsToMainLayout();
} else if (!inConfigureAppletsMode) {
splitMainLayoutToLayouts();
}*/
updateIndexes();
}
@ -627,6 +621,8 @@ Item {
Component.onDestruction: {
console.debug("Destroying Latte Dock Containment ui...");
animations.appletsInParentChange = true;
if (latteView) {
latteView.positioner.hideDockDuringLocationChangeStarted.disconnect(visibilityManager.slotHideDockDuringLocationChange);
latteView.positioner.showDockAfterLocationChangeFinished.disconnect(visibilityManager.slotShowDockAfterLocationChange);
@ -1116,12 +1112,15 @@ Item {
if (plasmoid.configuration.alignment !== 10) {
return;
}
animations.appletsInParentChange = true;
splitMainLayoutToLayouts();
animations.appletsInParentChange = false;
}
function splitMainLayoutToLayouts() {
if (internalViewSplittersCount() === 2) {
animations.appletsInParentChange = true;
console.log("LAYOUTS: Moving applets from MAIN to THREE Layouts mode...");
var splitter = -1;
var splitter2 = -1;
@ -1152,10 +1151,14 @@ Item {
var item = layoutsContainer.mainLayout.children[i];
LayoutManager.insertAtIndex(layoutsContainer.endLayout, item, 0);
}
animations.appletsInParentChange = false;
}
}
function joinLayoutsToMainLayout() {
animations.appletsInParentChange = true;
console.log("LAYOUTS: Moving applets from THREE to MAIN Layout mode...");
var totalChildren1 = layoutsContainer.mainLayout.children.length;
for (var i=totalChildren1-1; i>=0; --i) {
@ -1175,6 +1178,8 @@ Item {
var itemL = layoutsContainer.startLayout.children[0];
itemL.parent = layoutsContainer.mainLayout;
}
animations.appletsInParentChange = false;
}
function upgrader_v010_alignment() {