mirror of
https://github.com/KDE/latte-dock.git
synced 2025-01-26 18:03:42 +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:
parent
11f873e68a
commit
cc1f42824c
@ -118,14 +118,12 @@ Item{
|
||||
|
||||
normalState = ((root.nowDockHoveredIndex === -1) && (layoutsContainer.hoveredIndex === -1)
|
||||
&& (root.appletsAnimations === 0)
|
||||
&& (root.animationsNeedBothAxis === 0) && (root.animationsNeedLength === 0)
|
||||
&& (!mainLayout.animatedLength) ) || !windowSystem.compositingActive
|
||||
&& (root.animationsNeedBothAxis === 0) && (root.animationsNeedLength === 0)) || !windowSystem.compositingActive;
|
||||
|
||||
// debug maskArea criteria
|
||||
//console.log(root.nowDockHoveredIndex + ", " + layoutsContainer.hoveredIndex + ", "
|
||||
// + root.appletsAnimations+ ", "
|
||||
// + root.animationsNeedBothAxis + ", " + root.animationsNeedLength + ", " + root.animationsNeedThickness +", "
|
||||
// + mainLayout.animatedLength);
|
||||
// + root.animationsNeedBothAxis + ", " + root.animationsNeedLength + ", " + root.animationsNeedThickness);
|
||||
|
||||
var tempLength = root.isHorizontal ? width : height;
|
||||
var tempThickness = root.isHorizontal ? height : width;
|
||||
@ -192,8 +190,7 @@ Item{
|
||||
tempLength = Screen.height; //screenGeometry.height;
|
||||
|
||||
//grow only on length and not thickness
|
||||
if(mainLayout.animatedLength || root.editMode
|
||||
|| (root.animationsNeedLength>0 && root.animationsNeedBothAxis === 0)) {
|
||||
if(root.editMode || (root.animationsNeedLength>0 && root.animationsNeedBothAxis === 0)) {
|
||||
|
||||
//this is used to fix a bug with shadow showing when the animation of edit mode
|
||||
//is triggered
|
||||
|
@ -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(){
|
||||
layoutsContainer.currentSpot = -1000;
|
||||
layoutsContainer.hoveredIndex = -1;
|
||||
@ -883,7 +871,7 @@ DragDrop.DropArea {
|
||||
}
|
||||
|
||||
function updateAutomaticIconSize() {
|
||||
if (visibilityManager.normalState && !animatedLengthTimer.running && !root.editMode
|
||||
if (visibilityManager.normalState && !root.editMode
|
||||
&& (iconSize===plasmoid.configuration.iconSize || iconSize === automaticIconSizeBasedSize) ) {
|
||||
var layoutLength;
|
||||
var maxLength = dock.maxLength;
|
||||
@ -1100,21 +1088,7 @@ DragDrop.DropArea {
|
||||
Layout.preferredWidth: width
|
||||
Layout.preferredHeight: height
|
||||
|
||||
property bool animatedLength: false
|
||||
property int count: children.length
|
||||
|
||||
onHeightChanged: {
|
||||
if (root.isVertical && !root.editMode) {
|
||||
checkLayoutsAnimatedLength();
|
||||
}
|
||||
}
|
||||
|
||||
onWidthChanged: {
|
||||
if (root.isHorizontal && !root.editMode) {
|
||||
checkLayoutsAnimatedLength();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Grid{
|
||||
@ -1196,16 +1170,6 @@ DragDrop.DropArea {
|
||||
///////////////END UI 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{
|
||||
|
@ -881,6 +881,8 @@ MouseArea{
|
||||
id:showWindowAnimation
|
||||
property int speed: windowSystem.compositingActive ? root.durationTime* (1.2*units.longDuration) : 0
|
||||
|
||||
ScriptAction{script:{root.signalAnimationsNeedLength(1)}}
|
||||
|
||||
PropertyAnimation {
|
||||
target: wrapper
|
||||
property: (icList.orientation == Qt.Vertical) ? "tempScaleHeight" : "tempScaleWidth"
|
||||
@ -910,6 +912,8 @@ MouseArea{
|
||||
}
|
||||
}
|
||||
|
||||
ScriptAction{script:{root.signalAnimationsNeedLength(-1)}}
|
||||
|
||||
onStopped: {
|
||||
if(mainItemContainer.isWindow || mainItemContainer.isStartup){
|
||||
taskInitComponent.createObject(wrapper);
|
||||
@ -918,19 +922,11 @@ MouseArea{
|
||||
}
|
||||
}
|
||||
mainItemContainer.inAnimation = false;
|
||||
|
||||
if (isWindow || isStartup) {
|
||||
root.signalAnimationsNeedLength(-1);
|
||||
}
|
||||
}
|
||||
|
||||
function init(){
|
||||
wrapper.tempScaleWidth = 0;
|
||||
wrapper.tempScaleHeight = 0;
|
||||
|
||||
if (isWindow || isStartup) {
|
||||
root.signalAnimationsNeedLength(1);
|
||||
}
|
||||
}
|
||||
|
||||
function showWindow(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user