diff --git a/containment/package/contents/ui/EditModeVisual.qml b/containment/package/contents/ui/EditModeVisual.qml index 636958764..8a7ee6f16 100644 --- a/containment/package/contents/ui/EditModeVisual.qml +++ b/containment/package/contents/ui/EditModeVisual.qml @@ -25,13 +25,11 @@ import QtGraphicalEffects 1.0 import org.kde.latte 0.1 as Latte -Image{ +Item{ id: editVisual width: root.isHorizontal ? editLength : visibilityManager.thicknessNormalOriginal height: root.isVertical ? editLength : visibilityManager.thicknessNormalOriginal - fillMode: Image.Tile - source: "../icons/"+layoutColor+"print.jpg" opacity: 0 property int speed: root.durationTime*3*units.longDuration @@ -40,6 +38,8 @@ Image{ property int editLength: root.isHorizontal ? (root.behaveAsPlasmaPanel ? root.width - root.maxIconSize/4 : root.maxLength) : (root.behaveAsPlasmaPanel ? root.height - root.maxIconSize/4 : root.maxLength) + property real editStateOpacity: root.behaveAsPlasmaPanel ? 0.5 : root.blurEnabled ? 0.8 : 0.9 + property bool animationSent: false property bool farEdge: (plasmoid.location===PlasmaCore.Types.BottomEdge) || (plasmoid.location===PlasmaCore.Types.RightEdge) property bool editAnimationEnded: false @@ -48,11 +48,80 @@ Image{ property string layoutColor: root.dockManagedLayout ? root.dockManagedLayout.color : "blue" - layer.enabled: true - layer.effect: DropShadow { - radius: root.editShadow - samples: 2 * radius - color: "#aa080808" + + Item{ + id:topShadow + height: root.editShadow + width: imageTiler.width + 2*root.editShadow + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: imageTiler.top + clip: true + + visible: !editTransition.running + + EditShadow{ + anchors.top: parent.top + anchors.topMargin: root.editShadow + anchors.horizontalCenter: parent.horizontalCenter + } + } + + Item{ + id:leftShadow + width: root.editShadow + height: imageTiler.height + anchors.right: imageTiler.left + anchors.verticalCenter: imageTiler.verticalCenter + clip: true + + visible: !editTransition.running + + EditShadow{ + anchors.left: parent.left + anchors.leftMargin: root.editShadow + } + } + + Item{ + id:rightShadow + width: root.editShadow + height: imageTiler.height + anchors.left: imageTiler.right + anchors.verticalCenter: imageTiler.verticalCenter + clip: true + visible: !editTransition.running + + EditShadow{ + anchors.right: parent.right + anchors.rightMargin: root.editShadow + } + } + + Item{ + id:bottomShadow + height: root.editShadow + width: imageTiler.width + 2*root.editShadow + anchors.horizontalCenter: imageTiler.horizontalCenter + anchors.top: imageTiler.bottom + clip: true + visible: !editTransition.running + + EditShadow{ + anchors.bottom: parent.bottom + anchors.bottomMargin: root.editShadow + anchors.horizontalCenter: parent.horizontalCenter + } + } + + Image{ + id: imageTiler + anchors.centerIn: parent + width: parent.width + height: parent.height + opacity: editVisual.editStateOpacity + + fillMode: Image.Tile + source: "../icons/"+editVisual.layoutColor+"print.jpg" } /*Behavior on width { @@ -222,6 +291,7 @@ Image{ to: "edit" SequentialAnimation{ + id:normalAnimationTransition ScriptAction{ script:{ editVisual.opacity = 0 @@ -240,7 +310,7 @@ Image{ PropertyAnimation { target: editVisual property: "opacity" - to: root.behaveAsPlasmaPanel ? 0.4 : root.blurEnabled ? 0.7 : 0.8 + to: 1 duration: editVisual.speed / 2 easing.type: Easing.OutQuad } diff --git a/containment/package/contents/ui/EditShadow.qml b/containment/package/contents/ui/EditShadow.qml new file mode 100644 index 000000000..dd6d83801 --- /dev/null +++ b/containment/package/contents/ui/EditShadow.qml @@ -0,0 +1,39 @@ +/* +* Copyright 2016 Smith AR +* Michail Vourlakos +* +* This file is part of Latte-Dock +* +* Latte-Dock is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* Latte-Dock is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +import QtQuick 2.1 + +import org.kde.plasma.core 2.0 as PlasmaCore +import QtGraphicalEffects 1.0 + +import org.kde.latte 0.1 as Latte + +Rectangle{ + width: imageTiler.width + height: imageTiler.height + color: "white" + + layer.enabled: true + layer.effect: DropShadow { + radius: root.editShadow + samples: 2 * radius + color: "#040404" + } +} diff --git a/containment/package/contents/ui/VisibilityManager.qml b/containment/package/contents/ui/VisibilityManager.qml index 351354865..a4dcf64e8 100644 --- a/containment/package/contents/ui/VisibilityManager.qml +++ b/containment/package/contents/ui/VisibilityManager.qml @@ -63,11 +63,11 @@ Item{ //it is used to keep thickness solid e.g. when iconSize changes from auto functions property int thicknessMidOriginal: Math.max(thicknessNormalOriginal, statesLineSizeOriginal + thickReverseAndGlowExtraSizeOriginal + (1 + (0.65 * (root.zoomFactor-1)))*(root.maxIconSize+root.thickMarginOriginal)) //needed in some animations property int thicknessNormalOriginal: !root.behaveAsPlasmaPanel ? - Math.max(thicknessNormalOriginalValue + thickReverseAndGlowExtraSizeOriginal, root.realPanelSize + root.panelShadow) : + Math.max(thicknessNormalOriginalValue, root.realPanelSize + root.panelShadow) : root.realPanelSize + root.panelShadow property int thicknessNormalOriginalValue: statesLineSizeOriginal + thickReverseAndGlowExtraSizeOriginal + - root.maxIconSize + root.thickMarginOriginal + thickReverseAndGlowExtraSize + 1 + root.maxIconSize + root.thickMarginOriginal + 1 property int thicknessZoomOriginal: Math.max(statesLineSizeOriginal + thickReverseAndGlowExtraSizeOriginal + ((root.maxIconSize+root.thickMarginOriginal) * root.zoomFactor) + 2, root.realPanelSize + root.panelShadow) diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index 860fdf9c5..a4dd0cb4d 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -192,7 +192,7 @@ DragDrop.DropArea { property int panelMargin: 0 property int panelMarginLength: 0 property int panelShadow: 0 //shadowsSize - property int editShadow: Math.max(7, root.maxIconSize / 6) + property int editShadow: behaveAsPlasmaPanel ? 5 : Math.max(7, root.maxIconSize / 4) property int themePanelSize: { //root.statesLineSize + root.iconSize + root.iconMargin + 1 var panelBase = root.statesLineSize + root.panelMargin;