parabolic:provide better rapid movement indicator

--each item is now informing Parabolic ability about its
visible index when the mouser enters first time its area.
This is enough for parabolic effect to identify correctly
when there is mouse rapid movement.
work/spdx
Michail Vourlakos 4 years ago
parent 04d9cb7cb0
commit e102fcf792

@ -36,6 +36,8 @@ AbilityHost.ParabolicEffect {
readonly property bool horizontal: plasmoid.formFactor === PlasmaCore.Types.Horizontal
property int lastParabolicItemIndex: -1
Connections {
target: parabolic
onSglClearZoom: parabolic._privates.lastIndex = -1;
@ -97,6 +99,18 @@ AbilityHost.ParabolicEffect {
view.parabolic.currentItem = item;
}
function setCurrentParabolicItemIndex(index) {
if (!directRenderingEnabled
&& lastParabolicItemIndex > -1
&& index > -1
&& Math.abs(lastParabolicItemIndex-index) >=2 ) {
//! rapid movement
setDirectRenderingEnabled(true);
}
lastParabolicItemIndex = index;
}
function applyParabolicEffect(index, currentMousePosition, center) {
if (parabolic._privates.lastIndex === -1) {
setDirectRenderingEnabled(false);
@ -159,6 +173,7 @@ AbilityHost.ParabolicEffect {
return;
}
parabolic.lastParabolicItemIndex = -1;
parabolic.sglClearZoom();
if (debug.timersEnabled) {

@ -43,6 +43,10 @@ Item {
onEntered: {
appletItem.parabolic.setCurrentParabolicItem(_parabolicArea);
var vIndex = appletItem.indexer.visibleIndex(index);
appletItem.parabolic.setCurrentParabolicItemIndex(vIndex);
//! mouseX/Y can be trusted in that case in comparison to tasks that the relevant ParabolicAreaMouseArea does not
_parabolicArea.parabolicEntered(mouseX, mouseY);
}
@ -83,12 +87,6 @@ Item {
return;
}
var rapidMovement = appletItem.parabolic.lastIndex>=0 && Math.abs(appletItem.parabolic.lastIndex-index)>1;
if (rapidMovement) {
parabolic.setDirectRenderingEnabled(true);
}
if( ((wrapper.zoomScale === 1 || wrapper.zoomScale === appletItem.parabolic.factor.zoom) && !parabolic.directRenderingEnabled) || parabolic.directRenderingEnabled) {
if (root.isHorizontal){
var step = Math.abs(appletItem.layouts.currentSpot-mouseX);

@ -128,6 +128,12 @@ ClientAbility.ParabolicEffect {
}
}
function setCurrentParabolicItemIndex(index) {
if (bridge) {
bridge.parabolic.host.setCurrentParabolicItemIndex(index);
}
}
function applyParabolicEffect(index, currentMousePosition, center) {
if (parabolic.local._privates.lastIndex === -1) {

@ -42,6 +42,10 @@ Item {
onEntered: {
taskItem.parabolic.setCurrentParabolicItem(_parabolicArea);
var vIndex = taskItem.shortcuts.shortcutIndex(taskItem.itemIndex);
taskItem.parabolic.setCurrentParabolicItemIndex(vIndex);
// mouseX/Y can not be trusted at this point
//_parabolicArea.parabolicEntered(mouseX, mouseY);
}
@ -88,12 +92,6 @@ Item {
}
if((inAnimation == false)&&(!root.taskInAnimation)&&(!root.disableRestoreZoom) && taskItem.hoverEnabled){
var rapidMovement = taskItem.parabolic.local.lastIndex>=0 && Math.abs(taskItem.parabolic.local.lastIndex-itemIndex)>1;
if (rapidMovement) {
taskItem.parabolic.setDirectRenderingEnabled(true);
}
if( ((wrapper.mScale === 1 || wrapper.mScale === taskItem.parabolic.factor.zoom) && !taskItem.parabolic.directRenderingEnabled)
|| taskItem.parabolic.directRenderingEnabled || !taskItem.scalesUpdatedOnce) {
if(root.dragSource == null){

Loading…
Cancel
Save