block calculations for applets changing parents

pull/15/head
Michail Vourlakos 5 years ago
parent 97a1c3fdb8
commit 6ae3c499f0

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

@ -24,7 +24,8 @@ import "./privates" as Ability
Ability.IndexerPrivate { Ability.IndexerPrivate {
//! do not update during dragging/moving applets inConfigureAppletsMode //! 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) { function getClientBridge(index) {
if (clientsBridges.length<=0) { if (clientsBridges.length<=0) {

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

@ -55,7 +55,8 @@ Abilities.AbilityGrid {
property int lastVisibleIndex: -1 property int lastVisibleIndex: -1
//! do not update during dragging/moving applets inConfigureAppletsMode //! 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{ Binding{
target: appletsContainer target: appletsContainer

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

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

Loading…
Cancel
Save