1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-02-05 05:47:26 +03:00

fix #51, drop automaticAnimationLength flag

--the infrastructure is in place in order to not
need the automaticAnimationLength flag. From this
commit masking based totally only on animations
flags and on hovering indexes
This commit is contained in:
Michail Vourlakos 2017-01-13 20:29:32 +02:00
parent 11f873e68a
commit cc1f42824c
3 changed files with 8 additions and 51 deletions

View File

@ -118,14 +118,12 @@ Item{
normalState = ((root.nowDockHoveredIndex === -1) && (layoutsContainer.hoveredIndex === -1) normalState = ((root.nowDockHoveredIndex === -1) && (layoutsContainer.hoveredIndex === -1)
&& (root.appletsAnimations === 0) && (root.appletsAnimations === 0)
&& (root.animationsNeedBothAxis === 0) && (root.animationsNeedLength === 0) && (root.animationsNeedBothAxis === 0) && (root.animationsNeedLength === 0)) || !windowSystem.compositingActive;
&& (!mainLayout.animatedLength) ) || !windowSystem.compositingActive
// debug maskArea criteria // debug maskArea criteria
//console.log(root.nowDockHoveredIndex + ", " + layoutsContainer.hoveredIndex + ", " //console.log(root.nowDockHoveredIndex + ", " + layoutsContainer.hoveredIndex + ", "
// + root.appletsAnimations+ ", " // + root.appletsAnimations+ ", "
// + root.animationsNeedBothAxis + ", " + root.animationsNeedLength + ", " + root.animationsNeedThickness +", " // + root.animationsNeedBothAxis + ", " + root.animationsNeedLength + ", " + root.animationsNeedThickness);
// + mainLayout.animatedLength);
var tempLength = root.isHorizontal ? width : height; var tempLength = root.isHorizontal ? width : height;
var tempThickness = root.isHorizontal ? height : width; var tempThickness = root.isHorizontal ? height : width;
@ -192,8 +190,7 @@ Item{
tempLength = Screen.height; //screenGeometry.height; tempLength = Screen.height; //screenGeometry.height;
//grow only on length and not thickness //grow only on length and not thickness
if(mainLayout.animatedLength || root.editMode if(root.editMode || (root.animationsNeedLength>0 && root.animationsNeedBothAxis === 0)) {
|| (root.animationsNeedLength>0 && root.animationsNeedBothAxis === 0)) {
//this is used to fix a bug with shadow showing when the animation of edit mode //this is used to fix a bug with shadow showing when the animation of edit mode
//is triggered //is triggered

View File

@ -737,18 +737,6 @@ DragDrop.DropArea {
} }
} }
function checkLayoutsAnimatedLength() {
//After the last animations we must check again after a small delay in order
//to disable the automaticSizeUpdate
if (animatedLengthTimer.running) {
animatedLengthTimer.restart();
} else {
animatedLengthTimer.start();
}
visibilityManager.updateMaskArea();
}
function clearZoom(){ function clearZoom(){
layoutsContainer.currentSpot = -1000; layoutsContainer.currentSpot = -1000;
layoutsContainer.hoveredIndex = -1; layoutsContainer.hoveredIndex = -1;
@ -883,7 +871,7 @@ DragDrop.DropArea {
} }
function updateAutomaticIconSize() { function updateAutomaticIconSize() {
if (visibilityManager.normalState && !animatedLengthTimer.running && !root.editMode if (visibilityManager.normalState && !root.editMode
&& (iconSize===plasmoid.configuration.iconSize || iconSize === automaticIconSizeBasedSize) ) { && (iconSize===plasmoid.configuration.iconSize || iconSize === automaticIconSizeBasedSize) ) {
var layoutLength; var layoutLength;
var maxLength = dock.maxLength; var maxLength = dock.maxLength;
@ -1100,21 +1088,7 @@ DragDrop.DropArea {
Layout.preferredWidth: width Layout.preferredWidth: width
Layout.preferredHeight: height Layout.preferredHeight: height
property bool animatedLength: false
property int count: children.length property int count: children.length
onHeightChanged: {
if (root.isVertical && !root.editMode) {
checkLayoutsAnimatedLength();
}
}
onWidthChanged: {
if (root.isHorizontal && !root.editMode) {
checkLayoutsAnimatedLength();
}
}
} }
Grid{ Grid{
@ -1196,16 +1170,6 @@ DragDrop.DropArea {
///////////////END UI elements ///////////////END UI elements
///////////////BEGIN TIMER elements ///////////////BEGIN TIMER elements
Timer {
id: animatedLengthTimer
interval: 500
onTriggered: {
if ((appletsAnimations === 0) && (root.animationsNeedLength === 0) && (root.animationsNeedBothAxis === 0)) {
mainLayout.animatedLength = false;
visibilityManager.updateMaskArea();
}
}
}
//Timer to check if the mouse is still inside the ListView //Timer to check if the mouse is still inside the ListView
Timer{ Timer{

View File

@ -881,6 +881,8 @@ MouseArea{
id:showWindowAnimation id:showWindowAnimation
property int speed: windowSystem.compositingActive ? root.durationTime* (1.2*units.longDuration) : 0 property int speed: windowSystem.compositingActive ? root.durationTime* (1.2*units.longDuration) : 0
ScriptAction{script:{root.signalAnimationsNeedLength(1)}}
PropertyAnimation { PropertyAnimation {
target: wrapper target: wrapper
property: (icList.orientation == Qt.Vertical) ? "tempScaleHeight" : "tempScaleWidth" property: (icList.orientation == Qt.Vertical) ? "tempScaleHeight" : "tempScaleWidth"
@ -910,6 +912,8 @@ MouseArea{
} }
} }
ScriptAction{script:{root.signalAnimationsNeedLength(-1)}}
onStopped: { onStopped: {
if(mainItemContainer.isWindow || mainItemContainer.isStartup){ if(mainItemContainer.isWindow || mainItemContainer.isStartup){
taskInitComponent.createObject(wrapper); taskInitComponent.createObject(wrapper);
@ -918,19 +922,11 @@ MouseArea{
} }
} }
mainItemContainer.inAnimation = false; mainItemContainer.inAnimation = false;
if (isWindow || isStartup) {
root.signalAnimationsNeedLength(-1);
}
} }
function init(){ function init(){
wrapper.tempScaleWidth = 0; wrapper.tempScaleWidth = 0;
wrapper.tempScaleHeight = 0; wrapper.tempScaleHeight = 0;
if (isWindow || isStartup) {
root.signalAnimationsNeedLength(1);
}
} }
function showWindow(){ function showWindow(){