1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-02-10 09:57:35 +03:00

remove container parabolic.lastIndex requirement

This commit is contained in:
Michail Vourlakos 2021-01-05 20:45:07 +02:00
parent 0e002567dc
commit e9d5ae1ace
5 changed files with 15 additions and 20 deletions

View File

@ -41,7 +41,6 @@ AbilityHost.ParabolicEffect {
Connections {
target: parabolic
onSglClearZoom: parabolic._privates.lastIndex = -1;
onRestoreZoomIsBlockedChanged: {
if (!parabolic.restoreZoomIsBlocked) {
parabolic.startRestoreZoomTimer();
@ -148,13 +147,6 @@ AbilityHost.ParabolicEffect {
}
function applyParabolicEffect(index, currentMousePosition, center) {
if (parabolic._privates.lastIndex === -1) {
setDirectRenderingEnabled(false);
}
//! last item requested calculations
parabolic._privates.lastIndex = index;
var rDistance = Math.abs(currentMousePosition - center);
//check if the mouse goes right or down according to the center
@ -210,6 +202,7 @@ AbilityHost.ParabolicEffect {
}
parabolic.lastParabolicItemIndex = -1;
parabolic.setDirectRenderingEnabled(false);
parabolic.sglClearZoom();
if (debug.timersEnabled) {

View File

@ -20,5 +20,5 @@
import QtQuick 2.7
Item {
property int lastIndex: -1
}

View File

@ -33,6 +33,15 @@ ClientAbility.ParabolicEffect {
local.factor.maxZoom: isEnabled ? Math.max(local.factor.zoom, 1.6) : 1
readonly property bool horizontal: plasmoid.formFactor === PlasmaCore.Types.Horizontal
readonly property bool isHovered: {
if (bridge && bridge.parabolic.host.currentParabolicItem) {
return bridge.parabolic.host.currentParabolicItem.parent.parent.parent === layout;
}
return false;
}
property Item layout: null
Component.onCompleted: {
parabolic.sglUpdateLowerItemScale.connect(sltTrackLowerItemScale);
@ -46,7 +55,6 @@ ClientAbility.ParabolicEffect {
Connections {
target: parabolic
onSglClearZoom: parabolic.local._privates.lastIndex = -1;
onRestoreZoomIsBlockedChanged: {
if (!(bridge || bridge.host)) {
if (!parabolic.restoreZoomIsBlocked) {
@ -146,15 +154,7 @@ ClientAbility.ParabolicEffect {
}
}
function applyParabolicEffect(index, currentMousePosition, center) {
if (parabolic.local._privates.lastIndex === -1) {
setDirectRenderingEnabled(false);
}
//! last item requested calculations
parabolic.local._privates.lastIndex = index;
var rDistance = Math.abs(currentMousePosition - center);
//check if the mouse goes right or down according to the center
@ -221,6 +221,7 @@ ClientAbility.ParabolicEffect {
console.log("Plasmoid, restoreZoomTimer was called, even though it shouldn't...");
}
setDirectRenderingEnabled(false);
parabolic.invkClearZoom();
}
}

View File

@ -959,6 +959,7 @@ Item {
id: _parabolic
bridge: latteBridge
itemsCount: tasksModel.count
layout: icList.contentItem
local.isEnabled: factor.zoom > 1
local.restoreZoomIsBlocked: root.contextMenu || windowsPreviewDlg.containsMouse
}
@ -1143,7 +1144,7 @@ Item {
visible: root.dragAreaEnabled
property int maxThickness: (parabolic.local.lastIndex>=0 || windowPreviewIsShown || animations.hasThicknessAnimation) ?
property int maxThickness: (parabolic.isHovered || windowPreviewIsShown || animations.hasThicknessAnimation) ?
metrics.mask.thickness.zoomedForItems : metrics.mask.thickness.normalForItems
function onlyLaunchersInList(list){

View File

@ -679,7 +679,7 @@ MouseArea{
///////////////// Mouse Area Events ///////////////////
onEntered: {
if ((taskItem.parabolic.local.lastIndex !== itemIndex) && isLauncher && windowsPreviewDlg.visible) {
if (isLauncher && windowsPreviewDlg.visible) {
windowsPreviewDlg.hide(1);
}