From 15cf2b2b5fdb080251ab56ee7b893af9ac8c88a2 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Wed, 3 Mar 2021 20:34:47 +0200 Subject: [PATCH] replace more functions with fastLayoutManager --- containment/package/contents/ui/abilities/Layouter.qml | 4 ++-- .../ui/abilities/privates/layouter/AppletsContainer.qml | 2 +- containment/package/contents/ui/applet/ItemWrapper.qml | 2 +- containment/package/contents/ui/main.qml | 6 +++--- containment/plugin/layoutmanager.cpp | 2 -- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/containment/package/contents/ui/abilities/Layouter.qml b/containment/package/contents/ui/abilities/Layouter.qml index fbe8f1337..0ca21ebcc 100644 --- a/containment/package/contents/ui/abilities/Layouter.qml +++ b/containment/package/contents/ui/abilities/Layouter.qml @@ -30,8 +30,8 @@ Ability.LayouterPrivate { readonly property bool inNormalFillCalculationsState: animations.needBothAxis.count === 0 && animations.needThickness.count === 0 && (animations.needLength.count === 0 || root.dragInfo.entered) /*update when the user drags a plasmoid on the view*/ - && (!dragOverlay || (dragOverlay && !dragOverlay.pressed)) /*do not update during moving/dragging applets*/ - && !appletsInParentChange + // && (!dragOverlay || (dragOverlay && !dragOverlay.pressed)) /*do not update during moving/dragging applets*/ + // && !appletsInParentChange readonly property bool maxMetricsInHigherPriority: root.minLength === root.maxLength diff --git a/containment/package/contents/ui/abilities/privates/layouter/AppletsContainer.qml b/containment/package/contents/ui/abilities/privates/layouter/AppletsContainer.qml index 22e612e98..71d2b2460 100644 --- a/containment/package/contents/ui/abilities/privates/layouter/AppletsContainer.qml +++ b/containment/package/contents/ui/abilities/privates/layouter/AppletsContainer.qml @@ -45,7 +45,7 @@ Item { property int lastVisibleIndex: -1 //! do not update during dragging/moving applets inConfigureAppletsMode - readonly property bool updateIsBlocked: (root.dragOverlay && root.dragOverlay.pressed) || appletsInParentChange + readonly property bool updateIsBlocked: false// (root.dragOverlay && root.dragOverlay.pressed) || appletsInParentChange Binding{ target: appletsContainer diff --git a/containment/package/contents/ui/applet/ItemWrapper.qml b/containment/package/contents/ui/applet/ItemWrapper.qml index c679ba463..55ca31020 100644 --- a/containment/package/contents/ui/applet/ItemWrapper.qml +++ b/containment/package/contents/ui/applet/ItemWrapper.qml @@ -41,7 +41,7 @@ Item{ if (!root.inConfigureAppletsMode) { return 0; } else { - return appletItem.inConfigureAppletsDragging && (root.dragOverlay.currentApplet === appletItem || !root.dragOverlay.currentApplet.isInternalViewSplitter)? + return appletItem.inConfigureAppletsDragging && root.dragOverlay.currentApplet.isInternalViewSplitter ? appletMinimumLength : internalSplitterComputedLength; } } diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index 60376cd63..be6a32b55 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -638,12 +638,12 @@ Item { if ( (dndSpacer.parent === layoutsContainer.mainLayout) || (dndSpacer.parent === layoutsContainer.startLayout) || (dndSpacer.parent===layoutsContainer.endLayout)) { - LayoutManager.insertBeforeForLayout(dndSpacer.parent, dndSpacer, container); + fastLayoutManager.insertBefore(dndSpacer, container); dndSpacer.parent = root; return; // If the provided position is valid, use it. } else if (x >= 0 && y >= 0) { - var index = LayoutManager.insertAtCoordinates2(container, x , y); + var index = fastLayoutManager.insertAtCoordinates(container, x , y); // Fall through to determining an appropriate insert position. } else { @@ -675,7 +675,7 @@ Item { } if (before) { - LayoutManager.insertBefore(before, container); + fastLayoutManager.insertBefore(before, container); // Fall through to adding at the end. } else { diff --git a/containment/plugin/layoutmanager.cpp b/containment/plugin/layoutmanager.cpp index 93d04855f..c464728d2 100644 --- a/containment/plugin/layoutmanager.cpp +++ b/containment/plugin/layoutmanager.cpp @@ -209,13 +209,11 @@ bool LayoutManager::insertAtLayoutCoordinates(QQuickItem *layout, QQuickItem *it || (horizontal && ((x-neededspace) <= layout->width()) && (x>=0))) && layout->childItems().count()>0) { //! last item - qDebug() << "org.kde.latte << last item .."; hovered = layout->childItems()[layout->childItems().count()-1]; } else if ( ((vertical && (y >= -neededspace) && (y<=neededspace))) || (horizontal && (x >= -neededspace) && (x<=neededspace)) && layout->childItems().count()>0) { //! first item - qDebug() << "org.kde.latte << first item .."; hovered = layout->childItems()[0]; } else { return false;