mirror of
https://github.com/KDE/latte-dock.git
synced 2025-01-26 02:04:12 +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:
parent
e9a3bf9265
commit
dcda53d08e
@ -198,10 +198,10 @@ Item {
|
|||||||
|
|
||||||
function checkCanBeHovered(){
|
function checkCanBeHovered(){
|
||||||
if ( (((applet && (applet.Layout.minimumWidth > root.iconSize) && root.isHorizontal) ||
|
if ( (((applet && (applet.Layout.minimumWidth > root.iconSize) && root.isHorizontal) ||
|
||||||
(applet && (applet.Layout.minimumHeight > root.iconSize) && root.isVertical))
|
(applet && (applet.Layout.minimumHeight > root.iconSize) && root.isVertical))
|
||||||
&& (applet && applet.pluginName !== "org.kde.plasma.panelspacer")
|
&& (applet && applet.pluginName !== "org.kde.plasma.panelspacer")
|
||||||
&& !container.fakeIconItem)
|
&& !container.fakeIconItem)
|
||||||
|| (container.needsFillSpace)){
|
|| (container.needsFillSpace)){
|
||||||
canBeHovered = false;
|
canBeHovered = false;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -303,20 +303,36 @@ Item {
|
|||||||
root.clearZoomSignal.disconnect(clearZoom);
|
root.clearZoomSignal.disconnect(clearZoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Connections{
|
Connections{
|
||||||
target: root
|
target: root
|
||||||
onLatteAppletHoveredIndexChanged: {
|
onLatteAppletHoveredIndexChanged: {
|
||||||
if ( (root.zoomFactor>1) && (root.latteAppletHoveredIndex >= 0)
|
if ( (root.zoomFactor>1) && (root.latteAppletHoveredIndex >= 0) ){
|
||||||
&& (Math.abs(index-root.latteAppletPos+root.latteAppletHoveredIndex)>=3))
|
var distance = 2;
|
||||||
container.clearZoom();
|
//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{
|
Connections{
|
||||||
target: layoutsContainer
|
target: layoutsContainer
|
||||||
onHoveredIndexChanged:{
|
onHoveredIndexChanged:{
|
||||||
|
//for applets it is safe to consider that a distance of 2
|
||||||
|
//is enough to clearZoom
|
||||||
if ( (root.zoomFactor>1) && (layoutsContainer.hoveredIndex>=0)
|
if ( (root.zoomFactor>1) && (layoutsContainer.hoveredIndex>=0)
|
||||||
&& (Math.abs(index-layoutsContainer.hoveredIndex)>=3))
|
&& (Math.abs(index-layoutsContainer.hoveredIndex)>=2))
|
||||||
container.clearZoom();
|
container.clearZoom();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user