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

fix clearzoom when hover,no hoveredcapable applets

This commit is contained in:
Michail Vourlakos 2017-05-06 14:13:13 +03:00
parent 3cfcc909c5
commit 5c6a3a9d23
4 changed files with 56 additions and 4 deletions

View File

@ -1132,6 +1132,10 @@ Item {
onExited:{
if (appletIconItem)
appletIconItem.active = false;
if (root.zoomFactor>1){
checkRestoreZoom.start();
}
}
onPositionChanged: {

View File

@ -135,7 +135,7 @@ DragDrop.DropArea {
//center the layout correctly when the user uses an offset
property int offsetFixed: (offset===0 || panelAlignment === Latte.Dock.Center || plasmoid.configuration.panelPosition === Latte.Dock.Justify)?
offset : offset+panelMarginLength/2+totalPanelEdgeSpacing/2
offset : offset+panelMarginLength/2+totalPanelEdgeSpacing/2
property int realSize: iconSize + iconMargin
property int realPanelSize: 0
@ -973,6 +973,45 @@ DragDrop.DropArea {
return splitters;
}
function mouseInCanBeHoveredApplet(){
if (latteApplet && latteApplet.containsMouse())
return true;
var applets = startLayout.children;
for(var i=0; i<applets.length; ++i){
var applet = applets[i];
if(applet && applet.containsMouse && !applet.lockZoom && applet.canBeHovered){
return true;
}
}
applets = mainLayout.children;
for(var i=0; i<applets.length; ++i){
var applet = applets[i];
if(applet && applet.containsMouse && !applet.lockZoom && applet.canBeHovered){
return true;
}
}
///check second layout also
applets = endLayout.children;
for(var i=0; i<applets.length; ++i){
var applet = applets[i];
if(applet && applet.containsMouse && !applet.lockZoom && applet.canBeHovered){
return true;
}
}
return false;
}
function removeInternalViewSplitters(){
for (var container in mainLayout.children) {
var item = mainLayout.children[container];
@ -1772,7 +1811,8 @@ DragDrop.DropArea {
if (latteApplet && latteApplet.previewContainsMouse())
return;
if (!dock.visibility.containsMouse || (rootMouseArea.containsMouse && !root.editMode)){
if (!dock.visibility.containsMouse || (rootMouseArea.containsMouse && !root.editMode)
|| !mouseInCanBeHoveredApplet()){
if (enableDirectRenderTimer.running)
enableDirectRenderTimer.stop();

View File

@ -775,8 +775,8 @@ MouseArea{
///dont check to restore zooms
}
else{
if(!inAnimation && !root.latteDock){
checkListHovered.startNormal();
if(!inAnimation){
root.startCheckRestoreZoomTimer();
}
}

View File

@ -1349,6 +1349,14 @@ Item {
}
}
function startCheckRestoreZoomTimer() {
if (latteDock) {
latteDock.startCheckRestoreZoomTimer();
} else {
checkListHovered.startNormal();
}
}
///REMOVE
/*function createContextMenu(task) {
var menu = root.contextMenuComponent.createObject(task);