diff --git a/containment/package/contents/code/HeuristicTools.js b/containment/package/contents/code/HeuristicTools.js index a5246f7b2..4d1958f36 100644 --- a/containment/package/contents/code/HeuristicTools.js +++ b/containment/package/contents/code/HeuristicTools.js @@ -49,7 +49,7 @@ function computeStep2ForLayout(layout, sizePerApplet) { if (curApplet.needsFillSpace && curApplet.inFillCalculations) { curApplet.sizeForFill = sizePerApplet; - // console.log("s4_1 "+ sizePerApplet); + // console.log("s4_1 "+ sizePerApplet); curApplet.inFillCalculations = false; } } @@ -86,7 +86,8 @@ function initializationPhase(availableSpace, sizePerApplet, noOfApplets){ function updateSizeForAppletsInFill() { - if (visibilityManager.normalState && !root.editMode) { + if ((visibilityManager.normalState && !root.editMode) + || (behaveAsPlasmaPanel && root.editMode)) { // console.log("-------------"); // console.log("s1..."); var noA = startLayout.fillApplets + mainLayout.fillApplets + endLayout.fillApplets; diff --git a/containment/package/contents/ui/LayoutsContainer.qml b/containment/package/contents/ui/LayoutsContainer.qml index 5836c26ff..31e67703d 100644 --- a/containment/package/contents/ui/LayoutsContainer.qml +++ b/containment/package/contents/ui/LayoutsContainer.qml @@ -32,6 +32,9 @@ Item{ id: layoutsContainer readonly property bool isHidden: root.inStartup || (dock && dock.visibility && dock.visibility.isHidden) + readonly property bool useMaxLength: (plasmoid.configuration.panelPosition === Latte.Dock.Justify) + && ((!root.editMode && !root.behaveAsPlasmaPanel ) + || (behaveAsPlasmaPanel && root.editMode)) property int allCount: root.latteApplet ? _mainLayout.count-1+latteApplet.tasksCount : _mainLayout.count property int currentSpot: -1000 @@ -44,9 +47,8 @@ Item{ property Item endLayout: _endLayout x: { - if ( dock && (plasmoid.configuration.panelPosition === Latte.Dock.Justify) && root.isHorizontal - && !root.editMode && !root.behaveAsPlasmaPanel ){ - return ((dock.width/2) - (root.maxLength/2) + root.offset) + if ( dock && root.isHorizontal && useMaxLength ){ + return ((dock.width/2) - (root.maxLength/2)); // + root.offset) } else { if ((visibilityManager.inSlidingIn || visibilityManager.inSlidingOut) && root.isVertical){ return; @@ -69,9 +71,8 @@ Item{ } y: { - if ( dock && (plasmoid.configuration.panelPosition === Latte.Dock.Justify) && root.isVertical - && !root.editMode && !root.behaveAsPlasmaPanel ) { - return ((dock.height/2) - (root.maxLength/2) + root.offset); + if ( dock && root.isVertical && useMaxLength ) { + return ((dock.height/2) - (root.maxLength/2));// + root.offset); } else { if ((visibilityManager.inSlidingIn || visibilityManager.inSlidingOut) && root.isHorizontal){ return; @@ -93,10 +94,8 @@ Item{ } } - width: (plasmoid.configuration.panelPosition === Latte.Dock.Justify) && root.isHorizontal && !root.editMode && !root.behaveAsPlasmaPanel ? - root.maxLength : parent.width - height: (plasmoid.configuration.panelPosition === Latte.Dock.Justify) && root.isVertical && !root.editMode && !root.behaveAsPlasmaPanel ? - root.maxLength : parent.height + width: root.isHorizontal && useMaxLength ? root.maxLength : parent.width + height: root.isVertical && useMaxLength ? root.maxLength : parent.height z:10 property bool animationSent: false diff --git a/containment/package/contents/ui/PanelBox.qml b/containment/package/contents/ui/PanelBox.qml index 45c12152a..3be56b60b 100644 --- a/containment/package/contents/ui/PanelBox.qml +++ b/containment/package/contents/ui/PanelBox.qml @@ -41,10 +41,10 @@ Item{ property int animationTime: 6*root.durationTime*units.shortDuration property int panelWidth: { - if (root.behaveAsPlasmaPanel) { + if (root.behaveAsPlasmaPanel && !root.editMode) { return root.width; } else { - if ((root.panelAlignment === Latte.Dock.Justify) && root.isHorizontal && !root.editMode) { + if ((root.panelAlignment === Latte.Dock.Justify) && root.isHorizontal) { return root.maxLength; } else { return layoutsContainer.mainLayout.width + spacing; @@ -53,10 +53,10 @@ Item{ } property int panelHeight: { - if (root.behaveAsPlasmaPanel) { + if (root.behaveAsPlasmaPanel && !root.editMode) { return root.height; } else { - if ((root.panelAlignment === Latte.Dock.Justify) && root.isVertical && !root.editMode) { + if ((root.panelAlignment === Latte.Dock.Justify) && root.isVertical) { return root.maxLength; } else { return layoutsContainer.mainLayout.height + spacing; @@ -492,7 +492,7 @@ Item{ PropertyChanges{ target: barLine anchors.leftMargin: 0; anchors.rightMargin:0; anchors.topMargin:0; anchors.bottomMargin:0; - anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: root.offset; + anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0; } }, ///Right @@ -565,7 +565,7 @@ Item{ PropertyChanges{ target: barLine anchors.leftMargin: 0; anchors.rightMargin:0; anchors.topMargin:0; anchors.bottomMargin:0; - anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: root.offset; + anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0; } }, ///Bottom @@ -643,7 +643,7 @@ Item{ PropertyChanges{ target: barLine anchors.leftMargin: 0; anchors.rightMargin:0; anchors.topMargin:0; anchors.bottomMargin:0; - anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: root.offset; + anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0; } }, ///Top @@ -720,7 +720,7 @@ Item{ PropertyChanges{ target: barLine anchors.leftMargin: 0; anchors.rightMargin:0; anchors.topMargin:0; anchors.bottomMargin:0; - anchors.horizontalCenterOffset: root.offset; anchors.verticalCenterOffset: 0; + anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0; } } ]