1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-21 22:50:14 +03:00

improve parab.effect stability on first hovering

This commit is contained in:
Michail Vourlakos 2017-08-05 20:05:14 +03:00
parent f939dc51dc
commit bb2f5936b4
2 changed files with 38 additions and 34 deletions
containment/package/contents/ui/applet
plasmoid/package/contents/ui/task

@ -57,7 +57,7 @@ Item {
property bool showZoomed: false
property bool lockZoom: false
property bool isExpanded: applet && applet.status >= PlasmaCore.Types.NeedsAttentionStatus
&& applet.status !== PlasmaCore.Types.HiddenStatus
&& applet.status !== PlasmaCore.Types.HiddenStatus
property bool isHidden: applet && applet.status === PlasmaCore.Types.HiddenStatus ? true : false
property bool isInternalViewSplitter: (internalSplitterId > 0)
property bool isZoomed: false
@ -431,8 +431,8 @@ Item {
//in case there is a neighbour internal separator
property int separatorSpace: ((root.latteApplet && root.latteApplet.hasInternalSeparator
&& (root.latteApplet.internalSeparatorPos === root.tasksCount-1) && index===root.latteAppletPos+1)
|| neighbourSeparator) && !container.isSeparator && !container.latteApplet ? (2+root.iconMargin/2) : 0
&& (root.latteApplet.internalSeparatorPos === root.tasksCount-1) && index===root.latteAppletPos+1)
|| neighbourSeparator) && !container.isSeparator && !container.latteApplet ? (2+root.iconMargin/2) : 0
property real nHiddenSize: (nScale > 0) ? (container.spacersMaxSize * nScale) + separatorSpace : separatorSpace
property real nScale: 0
@ -492,8 +492,8 @@ Item {
property bool neighbourSeparator: false;
//in case there is a neighbour internal separator
property int separatorSpace: ((root.latteApplet && root.latteApplet.hasInternalSeparator
&& root.latteApplet.internalSeparatorPos === 0 && index===root.latteAppletPos-1)
|| neighbourSeparator) && !container.isSeparator && !container.latteApplet ? (2+root.iconMargin/2) : 0
&& root.latteApplet.internalSeparatorPos === 0 && index===root.latteAppletPos-1)
|| neighbourSeparator) && !container.isSeparator && !container.latteApplet ? (2+root.iconMargin/2) : 0
property real nHiddenSize: (nScale > 0) ? (container.spacersMaxSize * nScale) + separatorSpace : separatorSpace
property real nScale: 0
@ -641,25 +641,27 @@ Item {
return;
}
if (root.isHorizontal){
var step = Math.abs(layoutsContainer.currentSpot-mouse.x);
if (step >= container.animationStep){
layoutsContainer.hoveredIndex = index;
layoutsContainer.currentSpot = mouse.x;
if( ((wrapper.zoomScale == 1 || wrapper.zoomScale === root.zoomFactor) && !root.globalDirectRender) || root.globalDirectRender) {
if (root.isHorizontal){
var step = Math.abs(layoutsContainer.currentSpot-mouse.x);
if (step >= container.animationStep){
layoutsContainer.hoveredIndex = index;
layoutsContainer.currentSpot = mouse.x;
wrapper.calculateScales(mouse.x);
wrapper.calculateScales(mouse.x);
}
}
else{
var step = Math.abs(layoutsContainer.currentSpot-mouse.y);
if (step >= container.animationStep){
layoutsContainer.hoveredIndex = index;
layoutsContainer.currentSpot = mouse.y;
wrapper.calculateScales(mouse.y);
}
}
}
else{
var step = Math.abs(layoutsContainer.currentSpot-mouse.y);
if (step >= container.animationStep){
layoutsContainer.hoveredIndex = index;
layoutsContainer.currentSpot = mouse.y;
wrapper.calculateScales(mouse.y);
}
}
// }
mouse.accepted = false;
}

@ -599,23 +599,25 @@ MouseArea{
}
if((inAnimation == false)&&(!root.taskInAnimation)&&(!root.disableRestoreZoom) && hoverEnabled){
if(root.dragSource == null){
if (icList.orientation == Qt.Horizontal){
var step = Math.abs(icList.currentSpot-mouse.x);
if (step >= animationStep){
icList.hoveredIndex = index;
icList.currentSpot = mouse.x;
if( ((wrapper.mScale == 1 || wrapper.mScale === root.zoomFactor) && !root.globalDirectRender) || root.globalDirectRender) {
if(root.dragSource == null){
if (icList.orientation == Qt.Horizontal){
var step = Math.abs(icList.currentSpot-mouse.x);
if (step >= animationStep){
icList.hoveredIndex = index;
icList.currentSpot = mouse.x;
wrapper.calculateScales(mouse.x);
wrapper.calculateScales(mouse.x);
}
}
}
else{
var step = Math.abs(icList.currentSpot-mouse.y);
if (step >= animationStep){
icList.hoveredIndex = index;
icList.currentSpot = mouse.y;
else{
var step = Math.abs(icList.currentSpot-mouse.y);
if (step >= animationStep){
icList.hoveredIndex = index;
icList.currentSpot = mouse.y;
wrapper.calculateScales(mouse.y);
wrapper.calculateScales(mouse.y);
}
}
}
}