1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-09 17:18:11 +03:00

improve editMode triggering

--take into account the animations during
editMode activation/deactivation
This commit is contained in:
Michail Vourlakos 2018-02-11 23:51:30 +02:00
parent 96c9a22b70
commit 408476ce58
3 changed files with 21 additions and 19 deletions

View File

@ -39,11 +39,13 @@ Item{
property int editLength: root.isHorizontal ? (root.behaveAsPlasmaPanel ? root.width - root.maxIconSize/4 : root.width)://root.maxLength) :
(root.behaveAsPlasmaPanel ? root.height - root.maxIconSize/4 : root.height)
property real editStateOpacity: root.behaveAsPlasmaPanel ? 0.5 : 0.95// root.blurEnabled ? 0.8 : 0.9
property real editStateOpacity: 0.95 //root.behaveAsPlasmaPanel ? 0.5 : 0.95// 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
property bool plasmaEditMode: plasmoid.userConfiguring
property bool inEditMode: false
property rect efGeometry
@ -284,12 +286,12 @@ Item{
states: [
State{
name: "*"
when: !root.editMode
when: !plasmaEditMode
},
State{
name: "edit"
when: root.editMode
when: plasmaEditMode
}
]
@ -303,6 +305,7 @@ Item{
id:normalAnimationTransition
ScriptAction{
script:{
editVisual.inEditMode = true;
editVisual.opacity = 0
editVisual.editAnimationEnded = false;
@ -365,6 +368,7 @@ Item{
ScriptAction{
script:{
editVisual.inEditMode = false;
editVisual.editAnimationEnded = false;
if (editVisual.animationSent) {
root.slotAnimationsNeedLength(-1);

View File

@ -90,7 +90,7 @@ Item{
target: dock
property: "behaveAsPlasmaPanel"
when: dock
value: root.behaveAsPlasmaPanel
value: root.editMode ? false : root.behaveAsPlasmaPanel
}
Binding{
@ -391,7 +391,7 @@ Item{
newMaskArea.height = tempLength;
}
if (dock.behaveAsPlasmaPanel) {
if (dock.behaveAsPlasmaPanel && !root.editMode) {
dock.maskArea = Qt.rect(0,0,root.width,root.height);
} else {
dock.maskArea = newMaskArea;
@ -404,7 +404,7 @@ Item{
//the shadows size must be removed from the maskArea
//before updating the localDockGeometry
if (!dock.behaveAsPlasmaPanel) {
if (!dock.behaveAsPlasmaPanel || root.editMode) {
var fixedThickness = root.realPanelThickness;
if (plasmoid.formFactor === PlasmaCore.Types.Vertical) {

View File

@ -82,7 +82,7 @@ DragDrop.DropArea {
property bool disablePanelShadowMaximized: plasmoid.configuration.disablePanelShadowForMaximized
property bool drawShadowsExternal: panelShadowsActive && behaveAsPlasmaPanel && !visibilityManager.inTempHiding
property bool editMode: plasmoid.userConfiguring
property bool editMode: editModeVisual.inEditMode
property bool forceSolidPanel: plasmoid.configuration.solidBackgroundForMaximized && (dock.visibility.existsWindowMaximized || dock.visibility.existsWindowSnapped)
property bool forceTransparentPanel: root.backgroundOnlyOnMaximized
&& !(dock.visibility.existsWindowMaximized || dock.visibility.existsWindowSnapped)
@ -1476,16 +1476,7 @@ DragDrop.DropArea {
EditModeVisual{
id:editModeVisual
z: root.behaveAsPlasmaPanel ? 1 : 0
}
Item{
id: panelBox
anchors.fill:layoutsContainer
z: root.behaveAsPlasmaPanel ? 0 : 1
PanelBox{}
// z: root.behaveAsPlasmaPanel ? 1 : 0
}
Ruler{
@ -1505,11 +1496,18 @@ DragDrop.DropArea {
}
}
z: 2
opacity: root.editMode ? 1 : 0
}
Item{
id: panelBox
anchors.fill:layoutsContainer
// z: root.behaveAsPlasmaPanel ? 0 : 1
PanelBox{}
}
Item {
id: lastSpacer
parent: layoutsContainer.mainLayout