From fac1ed6be60f3cd46bb138c2c96ba409d738c7cf Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 13 Mar 2017 22:37:33 +0200 Subject: [PATCH] restore modes for !compositing --support hiding modes when !compositing, improve apperance/calculations a bit for !compositing --- containment/contents/ui/EditModeVisual.qml | 4 +++ containment/contents/ui/VisibilityManager.qml | 26 +++++++++++++------ containment/contents/ui/main.qml | 26 +++++++++++++++---- 3 files changed, 43 insertions(+), 13 deletions(-) diff --git a/containment/contents/ui/EditModeVisual.qml b/containment/contents/ui/EditModeVisual.qml index 01d805ddd..81093b799 100644 --- a/containment/contents/ui/EditModeVisual.qml +++ b/containment/contents/ui/EditModeVisual.qml @@ -77,6 +77,10 @@ Image{ } onEditAnimationEndedChanged: { + if (!dock) { + return; + } + if (editAnimationEnded && !root.drawShadowsExternal) { dock.shadow = root.editShadow; } else { diff --git a/containment/contents/ui/VisibilityManager.qml b/containment/contents/ui/VisibilityManager.qml index e47bce15c..53b62a5c4 100644 --- a/containment/contents/ui/VisibilityManager.qml +++ b/containment/contents/ui/VisibilityManager.qml @@ -40,17 +40,17 @@ Item{ property bool previousNormalState : false // this is only for debugging purposes property bool panelIsBiggerFromIconSize: root.useThemePanel && (root.themePanelSize >= root.iconSize) - property int animationSpeed: root.durationTime * 1.2 * units.longDuration + property int animationSpeed: Latte.WindowSystem.compositingActive ? root.durationTime * 1.2 * units.longDuration : 0 property bool inSlidingIn: false //necessary because of its init structure property alias inSlidingOut: slidingAnimationAutoHiddenOut.running property int length: root.isVertical ? Screen.height : Screen.width //screenGeometry.height : screenGeometry.width - property int slidingOutToPos: ((plasmoid.location===PlasmaCore.Types.LeftEdge)||(plasmoid.location===PlasmaCore.Types.TopEdge)) ? -thicknessNormal : thicknessNormal - + property int slidingOutToPos: ((plasmoid.location===PlasmaCore.Types.LeftEdge)||(plasmoid.location===PlasmaCore.Types.TopEdge)) ? + -thicknessNormal : thicknessNormal; property int statesLineSizeOriginal: root.latteApplet ? Math.ceil( root.maxIconSize/13 ) : 0 - property int thicknessAutoHidden: 2 + property int thicknessAutoHidden: Latte.WindowSystem.compositingActive ? 2 : 1 property int thicknessMid: root.statesLineSize + (1 + (0.65 * (root.zoomFactor-1)))*(root.iconSize+root.thickMargin) //needed in some animations property int thicknessNormal: Math.max(root.statesLineSize + root.iconSize + root.thickMargin + 1, root.realPanelSize + root.panelShadow) property int thicknessZoom: root.statesLineSize + ((root.iconSize+root.thickMargin) * root.zoomFactor) + 2 @@ -146,7 +146,7 @@ Item{ function slotMustBeHide() { // console.log("hide...."); if(!slidingAnimationAutoHiddenOut.running && !dock.visibility.blockHiding - && !dock.visibility.containsMouse && Latte.WindowSystem.compositingActive) { + && !dock.visibility.containsMouse) { slidingAnimationAutoHiddenOut.init(); } } @@ -214,7 +214,7 @@ Item{ } if (dock.visibility.isHidden && !slidingAnimationAutoHiddenOut.running ) { - tempThickness = Latte.WindowSystem.compositingActive ? thicknessAutoHidden : thicknessNormalOriginal; + tempThickness = thicknessAutoHidden; } //configure x,y based on plasmoid position and root.panelAlignment(Alignment) @@ -268,7 +268,7 @@ Item{ tempThickness = root.editMode ? editModeThickness : thicknessNormalOriginal; if (dock.visibility.isHidden && !slidingAnimationAutoHiddenOut.running ) { - tempThickness = Latte.WindowSystem.compositingActive ? thicknessAutoHidden : thicknessNormalOriginal; + tempThickness = thicknessAutoHidden; } else if (root.animationsNeedThickness > 0) { tempThickness = thicknessMidOriginal; } @@ -399,7 +399,17 @@ Item{ PropertyAnimation { target: layoutsContainer property: root.isVertical ? "x" : "y" - to: slidingOutToPos + to: { + if (Latte.WindowSystem.compositingActive) { + return slidingOutToPos; + } else { + if ((plasmoid.location===PlasmaCore.Types.LeftEdge)||(plasmoid.location===PlasmaCore.Types.TopEdge)) { + return slidingOutToPos + 1; + } else { + return slidingOutToPos - 1; + } + } + } duration: manager.animationSpeed easing.type: Easing.OutQuad } diff --git a/containment/contents/ui/main.qml b/containment/contents/ui/main.qml index d1702eb17..09c382def 100644 --- a/containment/contents/ui/main.qml +++ b/containment/contents/ui/main.qml @@ -1129,7 +1129,7 @@ DragDrop.DropArea { //! Load a sepia background in order to avoid black background Loader{ anchors.fill: parent - active: !Latte.WindowSystem.compositingActive && root.editMode + active: !Latte.WindowSystem.compositingActive sourceComponent: Image{ anchors.fill: parent fillMode: Image.Tile @@ -1221,8 +1221,16 @@ DragDrop.DropArea { return; } - if (dock.visibility.isHidden && Latte.WindowSystem.compositingActive && root.isVertical) { - return visibilityManager.slidingOutToPos; + if (dock.visibility.isHidden && root.isVertical) { + if (Latte.WindowSystem.compositingActive) { + return slidingOutToPos; + } else { + if ((plasmoid.location===PlasmaCore.Types.LeftEdge)||(plasmoid.location===PlasmaCore.Types.TopEdge)) { + return slidingOutToPos + 1; + } else { + return slidingOutToPos - 1; + } + } } else { return 0; } @@ -1238,8 +1246,16 @@ DragDrop.DropArea { return; } - if (dock.visibility.isHidden && Latte.WindowSystem.compositingActive && root.isHorizontal) { - return visibilityManager.slidingOutToPos; + if (dock.visibility.isHidden && root.isHorizontal) { + if (Latte.WindowSystem.compositingActive) { + return slidingOutToPos; + } else { + if ((plasmoid.location===PlasmaCore.Types.LeftEdge)||(plasmoid.location===PlasmaCore.Types.TopEdge)) { + return slidingOutToPos + 1; + } else { + return slidingOutToPos - 1; + } + } } else { return 0; }