From a1ec6de41269d253ffc300d298b0408cc6e04e63 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 27 Dec 2020 23:37:46 +0200 Subject: [PATCH] tasks:make parabolic effect fixes --- app/view/view.cpp | 4 ++-- .../package/contents/ui/applet/ParabolicArea.qml | 7 +++---- plasmoid/package/contents/ui/task/ParabolicArea.qml | 10 +++++----- plasmoid/package/contents/ui/task/TaskItem.qml | 4 ++-- plasmoid/package/contents/ui/task/Wrapper.qml | 2 -- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/app/view/view.cpp b/app/view/view.cpp index ca3c3d392..741796cac 100644 --- a/app/view/view.cpp +++ b/app/view/view.cpp @@ -1432,8 +1432,8 @@ bool View::event(QEvent *e) QMetaObject::invokeMethod(m_currentParabolicItem, "parabolicMove", Qt::DirectConnection, - Q_ARG(int, internal.x()), - Q_ARG(int, internal.y())); + Q_ARG(qreal, internal.x()), + Q_ARG(qreal, internal.y())); } else { //! clearing parabolic item setCurrentParabolicItem(nullptr); diff --git a/containment/package/contents/ui/applet/ParabolicArea.qml b/containment/package/contents/ui/applet/ParabolicArea.qml index 14f9fd46f..ecdf0867c 100644 --- a/containment/package/contents/ui/applet/ParabolicArea.qml +++ b/containment/package/contents/ui/applet/ParabolicArea.qml @@ -22,8 +22,8 @@ import org.kde.plasma.core 2.0 as PlasmaCore Item { id: _parabolicArea - signal parabolicEntered(int mouseX, int mouseY); - signal parabolicMove(int mouseX, int mouseY); + signal parabolicEntered(real mouseX, real mouseY); + signal parabolicMove(real mouseX, real mouseY); signal parabolicExited(); readonly property bool containsMouse: appletItem.parabolic.currentParabolicItem === _parabolicArea @@ -80,8 +80,7 @@ Item { if (root.isHorizontal){ appletItem.layouts.currentSpot = mouseX; calculateParabolicScales(mouseX); - } - else{ + } else{ appletItem.layouts.currentSpot = mouseY; calculateParabolicScales(mouseY); } diff --git a/plasmoid/package/contents/ui/task/ParabolicArea.qml b/plasmoid/package/contents/ui/task/ParabolicArea.qml index 143412a82..3a03cb5f2 100644 --- a/plasmoid/package/contents/ui/task/ParabolicArea.qml +++ b/plasmoid/package/contents/ui/task/ParabolicArea.qml @@ -22,15 +22,13 @@ import org.kde.plasma.core 2.0 as PlasmaCore Item { id: _parabolicArea - signal parabolicEntered(int mouseX, int mouseY); - signal parabolicMove(int mouseX, int mouseY); + signal parabolicEntered(real mouseX, real mouseY); + signal parabolicMove(real mouseX, real mouseY); signal parabolicExited(); readonly property bool containsMouse: taskItem.parabolic.currentParabolicItem === _parabolicArea - property real center:root.isHorizontal ? - (wrapper.width + hiddenSpacerLeft.separatorSpace + hiddenSpacerRight.separatorSpace) / 2 : - (wrapper.height + hiddenSpacerLeft.separatorSpace + hiddenSpacerRight.separatorSpace) / 2 + readonly property real center: wrapper.center MouseArea { id: parabolicMouseArea @@ -91,6 +89,8 @@ Item { if (root.autoScrollTasksEnabled) { scrollableList.autoScrollFor(taskItem, false); } + + //! do not send any parabolic mouse movement. At this point mouseX/Y are not valid } onParabolicMove: { diff --git a/plasmoid/package/contents/ui/task/TaskItem.qml b/plasmoid/package/contents/ui/task/TaskItem.qml index b146ae96c..9394a1ec6 100644 --- a/plasmoid/package/contents/ui/task/TaskItem.qml +++ b/plasmoid/package/contents/ui/task/TaskItem.qml @@ -433,9 +433,9 @@ MouseArea{ onDockIsShownCompletelyChanged: { if (dockIsShownCompletely && taskItem.containsMouse) { if (root.vertical) { - taskItem.mousePosChanged(taskItem.mouseY); + // taskItem.mousePosChanged(taskItem.mouseY); } else { - taskItem.mousePosChanged(taskItem.mouseX); + // taskItem.mousePosChanged(taskItem.mouseX); } } } diff --git a/plasmoid/package/contents/ui/task/Wrapper.qml b/plasmoid/package/contents/ui/task/Wrapper.qml index 0d6a26013..ac169c0b8 100644 --- a/plasmoid/package/contents/ui/task/Wrapper.qml +++ b/plasmoid/package/contents/ui/task/Wrapper.qml @@ -94,8 +94,6 @@ Item{ property real visualScaledHeight: (taskItem.metrics.iconSize + root.internalHeightMargins) * mScale /// end of Scalers/////// - // property int index: taskItem.Positioner.index - //property real center: (width + hiddenSpacerLeft.separatorSpace + hiddenSpacerRight.separatorSpace) / 2 property real center: !root.vertical ? (width + hiddenSpacerLeft.separatorSpace + hiddenSpacerRight.separatorSpace) / 2 : (height + hiddenSpacerLeft.separatorSpace + hiddenSpacerRight.separatorSpace) / 2