From f5f254c0db9b4505f885b1699cc8ca56f62bbf72 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 11 Feb 2018 17:20:06 +0200 Subject: [PATCH] enable automatic sizes in edit mode --block also the editing background to change size --- .../package/contents/ui/EditModeVisual.qml | 28 ++++++++++++------- .../package/contents/ui/LayoutsContainer.qml | 7 ----- containment/package/contents/ui/main.qml | 10 +++++-- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/containment/package/contents/ui/EditModeVisual.qml b/containment/package/contents/ui/EditModeVisual.qml index 54a6c023c..0e2c490fb 100644 --- a/containment/package/contents/ui/EditModeVisual.qml +++ b/containment/package/contents/ui/EditModeVisual.qml @@ -140,12 +140,12 @@ Item{ onLocationChanged: initializeEditPosition(); } - Connections{ + /* Connections{ target: root onIconSizeChanged: initializeEditPosition(); onPanelAlignmentChanged: initializeEditPosition(); onOffsetChanged: initializeEditPosition(); - } + }*/ onRootThicknessChanged: { initializeEditPosition(); @@ -171,17 +171,17 @@ Item{ onYChanged: updateEffectsArea(); onWidthChanged: { - if (root.isHorizontal) { + /*if (root.isHorizontal) { initializeEditPosition(); - } + }*/ updateEffectsArea(); } onHeightChanged: { - if (root.isVertical) { + /* if (root.isVertical) { initializeEditPosition(); - } + }*/ updateEffectsArea(); } @@ -204,15 +204,19 @@ Item{ function initializeNormalPosition() { if (plasmoid.location === PlasmaCore.Types.BottomEdge) { y = rootThickness; + x = 0; } else if (plasmoid.location === PlasmaCore.Types.RightEdge) { x = rootThickness; + y = 0; } else if (plasmoid.location === PlasmaCore.Types.LeftEdge) { x = -editVisual.thickness; + y = 0; } else if (plasmoid.location === PlasmaCore.Types.TopEdge) { y = -editVisual.thickness; + x = 0; } - if (root.isHorizontal) { + /* if (root.isHorizontal) { if (plasmoid.configuration.panelPosition === Latte.Dock.Justify) { x = root.width/2 - editVisual.editLength/2 + root.offset; } else if (root.panelAlignment === Latte.Dock.Left) { @@ -232,22 +236,26 @@ Item{ } else if (root.panelAlignment === Latte.Dock.Bottom) { y = root.height - editVisual.editLength - root.offset; } - } + }*/ } function initializeEditPosition() { if (root.editMode) { if (plasmoid.location === PlasmaCore.Types.LeftEdge){ x = 0; + y = 0; } else if (plasmoid.location === PlasmaCore.Types.TopEdge) { + x = 0; y = 0; } else if (plasmoid.location === PlasmaCore.Types.BottomEdge) { + x = 0; y = rootThickness - thickness; } else if (plasmoid.location === PlasmaCore.Types.RightEdge) { x = rootThickness - thickness; + y = 0; } - if (root.isHorizontal) { + /* if (root.isHorizontal) { if (plasmoid.configuration.panelPosition === Latte.Dock.Justify) { x = root.width/2 - editVisual.width/2 + root.offset; } else if (root.panelAlignment === Latte.Dock.Left) { @@ -267,7 +275,7 @@ Item{ } else if (root.panelAlignment === Latte.Dock.Bottom) { y = root.height - editVisual.height - root.offset; } - } + }*/ } } diff --git a/containment/package/contents/ui/LayoutsContainer.qml b/containment/package/contents/ui/LayoutsContainer.qml index 2cabd19ce..5836c26ff 100644 --- a/containment/package/contents/ui/LayoutsContainer.qml +++ b/containment/package/contents/ui/LayoutsContainer.qml @@ -353,13 +353,6 @@ Item{ onSizeWithNoFillAppletsChanged: HeuristicTools.updateSizeForAppletsInFill(); - transitions: Transition { - NumberAnimation { - duration: root.animationTime - easing.type: Easing.OutQuad - } - } - //////////////////////////BEGIN states //user set Panel Positions // 0-Center, 1-Left, 2-Right, 3-Top, 4-Bottom diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index cc3478f23..4d6be3094 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -407,6 +407,7 @@ DragDrop.DropArea { onEditModeChanged: { if (editMode) { visibilityManager.updateMaskArea(); + updateAutomaticIconSize(); } else { updateAutomaticIconSize(); layoutsContainer.updateSizeForAppletsInFill(); @@ -541,7 +542,12 @@ DragDrop.DropArea { //dndSpacer.parent = root; } - onMaxLengthChanged: layoutsContainer.updateSizeForAppletsInFill(); + onMaxLengthChanged: { + layoutsContainer.updateSizeForAppletsInFill(); + if (root.editMode) { + updateAutomaticIconSize(); + } + } onToolBoxChanged: { if (toolBox) { @@ -1107,7 +1113,7 @@ DragDrop.DropArea { function updateAutomaticIconSize() { if ( !blockAutomaticUpdateIconSize.running - && (visibilityManager.normalState && !root.editMode && !visibilityManager.inTempHiding + && ((visibilityManager.normalState || root.editMode) && !visibilityManager.inTempHiding && (root.autoDecreaseIconSize || (!root.autoDecreaseIconSize && root.iconSize!=root.maxIconSize))) && (iconSize===root.maxIconSize || iconSize === automaticIconSizeBasedSize) ) { blockAutomaticUpdateIconSize.start();