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

go the applets clearZoom criteria to the edges

--the clearZoom criteria for the applets have set
to the minimum possible considering also the internal
tasks separator case
This commit is contained in:
Michail Vourlakos 2017-05-21 00:08:44 +03:00
parent e9a3bf9265
commit dcda53d08e

View File

@ -198,10 +198,10 @@ Item {
function checkCanBeHovered(){
if ( (((applet && (applet.Layout.minimumWidth > root.iconSize) && root.isHorizontal) ||
(applet && (applet.Layout.minimumHeight > root.iconSize) && root.isVertical))
&& (applet && applet.pluginName !== "org.kde.plasma.panelspacer")
&& !container.fakeIconItem)
|| (container.needsFillSpace)){
(applet && (applet.Layout.minimumHeight > root.iconSize) && root.isVertical))
&& (applet && applet.pluginName !== "org.kde.plasma.panelspacer")
&& !container.fakeIconItem)
|| (container.needsFillSpace)){
canBeHovered = false;
}
else{
@ -303,20 +303,36 @@ Item {
root.clearZoomSignal.disconnect(clearZoom);
}
Connections{
target: root
onLatteAppletHoveredIndexChanged: {
if ( (root.zoomFactor>1) && (root.latteAppletHoveredIndex >= 0)
&& (Math.abs(index-root.latteAppletPos+root.latteAppletHoveredIndex)>=3))
container.clearZoom();
if ( (root.zoomFactor>1) && (root.latteAppletHoveredIndex >= 0) ){
var distance = 2;
//for Tasks plasmoid distance of 2 is not always safe there are
//cases that needs to be 3, when an internal separator there is
//between the hovered task and the current applet
if (root.latteInternalSeparatorPos>=0) {
if ((index < root.latteAppletPos && root.latteInternalSeparatorPos < root.latteAppletHoveredIndex)
|| (index > root.latteAppletPos && root.latteInternalSeparatorPos > root.latteAppletHoveredIndex)) {
distance = 3;
}
}
if(Math.abs(index-root.latteAppletPos+root.latteAppletHoveredIndex)>=distance) {
container.clearZoom();
}
}
}
}
Connections{
target: layoutsContainer
onHoveredIndexChanged:{
//for applets it is safe to consider that a distance of 2
//is enough to clearZoom
if ( (root.zoomFactor>1) && (layoutsContainer.hoveredIndex>=0)
&& (Math.abs(index-layoutsContainer.hoveredIndex)>=3))
&& (Math.abs(index-layoutsContainer.hoveredIndex)>=2))
container.clearZoom();
}
}