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

improvements to applets parabolic effect

This commit is contained in:
Michail Vourlakos 2018-02-19 00:26:07 +02:00
parent a018dd8fa8
commit 7c1cd0cb70
3 changed files with 31 additions and 19 deletions

View File

@ -218,11 +218,11 @@ Item {
//property int debCounter: 0;
function clearZoom(){
if (layoutsContainer.hoveredIndex === -1) {
if (root.globalDirectRender){
wrapper.zoomScale = 1;
} else {
// if (root.globalDirectRender){
// wrapper.zoomScale = 1;
//} else {
restoreAnimation.start();
}
// }
}
}
@ -388,8 +388,8 @@ Item {
onGlobalDirectRenderChanged:{
if (root.globalDirectRender && restoreAnimation.running) {
// console.log("CLEAR APPLET SCALE !!!!");
restoreAnimation.stop();
wrapper.zoomScale = 1;
//restoreAnimation.stop();
//wrapper.zoomScale = 1;
}
}
@ -426,6 +426,10 @@ Item {
if ( (root.zoomFactor>1) && (layoutsContainer.hoveredIndex>=0)
&& (Math.abs(index-layoutsContainer.hoveredIndex)>=2))
container.clearZoom();
if ((layoutsContainer.hoveredIndex !== -1) && (restoreAnimation.running)) {
restoreAnimation.stop();
}
}
}
@ -555,6 +559,9 @@ Item {
onEntered: {
//AppletIndetifier.reconsiderAppletIconItem();
if (restoreAnimation.running) {
restoreAnimation.stop();
}
root.showTooltipLabel(container, applet.title);
@ -592,6 +599,10 @@ Item {
}
onExited:{
if (fastEnteringFlag) {
fastEnteringFlag = false;
}
if (appletIconItem && appletIconItem.visible)
appletIconItem.active = false;
@ -628,7 +639,7 @@ Item {
&& lengthPos <= (wrapper.center + root.iconSize/2)) {
if (!enableDirectRenderTimer.running && !root.globalDirectRender) {
root.setGlobalDirectRender(true);
enableDirectRenderTimer.start();
// enableDirectRenderTimer.start();
}
fastEnteringFlag = false;

View File

@ -210,7 +210,7 @@ Item{
onZoomScaleChanged: {
if ((zoomScale === root.zoomFactor) && !enableDirectRenderTimer.running && !root.globalDirectRender) {
root.setGlobalDirectRender(true);
enableDirectRenderTimer.start();
// enableDirectRenderTimer.start();
}
if ((zoomScale > 1) && !container.isZoomed) {

View File

@ -429,7 +429,7 @@ DragDrop.DropArea {
} else {
updateAutomaticIconSize();
layoutsContainer.updateSizeForAppletsInFill();
setGlobalDirectRender(false);
// setGlobalDirectRender(false);
}
updateLayouts();
@ -938,7 +938,7 @@ DragDrop.DropArea {
function disableDirectRender(){
root.globalDirectRender = false;
// root.globalDirectRender = false;
}
function internalViewSplittersCount(){
@ -1013,6 +1013,10 @@ DragDrop.DropArea {
return false;
}
function mouseInHoverableArea() {
return (dock.visibility.containsMouse && !rootMouseArea.containsMouse && mouseInCanBeHoveredApplet());
}
function removeInternalViewSplitters(){
for (var container in layoutsContainer.mainLayout.children) {
var item = layoutsContainer.mainLayout.children[container];
@ -1119,7 +1123,7 @@ DragDrop.DropArea {
return;
if (value === true) {
if (dockContainsMouse && !rootMouseArea.containsMouse) {
if (mouseInCanBeHoveredApplet()) {
root.globalDirectRender = true;
} else {
// console.log("direct render true ignored...");
@ -1572,7 +1576,7 @@ DragDrop.DropArea {
//Timer to check if the mouse is still outside the dock in order to restore zooms to 1.0
Timer{
id:checkRestoreZoom
interval: 50
interval: 120
onTriggered: {
if (latteApplet && (latteApplet.previewContainsMouse() || latteApplet.contextMenu))
@ -1581,10 +1585,7 @@ DragDrop.DropArea {
if (dock.contextMenuIsShown)
return;
//! dropped because was creating a glitch when the user was clicking the area
//! underneath the applet until the screen edge and the applet was zoomed
// || (rootMouseArea.containsMouse && !root.editMode)
if (!dock.visibility.containsMouse || rootMouseArea.containsMouse || !mouseInCanBeHoveredApplet()) {
if (!mouseInHoverableArea()) {
if (enableDirectRenderTimer.running)
enableDirectRenderTimer.stop();
@ -1604,9 +1605,9 @@ DragDrop.DropArea {
//during first hovering phase
Timer {
id: enableDirectRenderTimer
interval: checkRestoreZoom.interval + 20 //4 * root.durationTime * units.shortDuration
interval: 0 //checkRestoreZoom.interval + 20 //4 * root.durationTime * units.shortDuration
onTriggered: {
if (latteApplet && latteApplet.waitingLaunchers.length > 0)
/* if (latteApplet && latteApplet.waitingLaunchers.length > 0)
return;
if (dock.visibility.containsMouse && !rootMouseArea.containsMouse && mouseInCanBeHoveredApplet()){
@ -1615,7 +1616,7 @@ DragDrop.DropArea {
if (root.debugModeTimers) {
console.log("containment timer: enableDirectRenderTimer called...");
}
}*/
}
}