From 23439334083c2aebad4543610c51ea6f19b1f3ef Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 22 May 2020 21:35:06 +0300 Subject: [PATCH] remove Container ParabolicManager --this is not needed any more from the container. All its functionality is provided from various Container Abilities. --- .../package/contents/ui/ParabolicManager.qml | 202 ------------------ .../package/contents/ui/applet/AppletItem.qml | 4 - containment/package/contents/ui/main.qml | 5 - 3 files changed, 211 deletions(-) delete mode 100644 containment/package/contents/ui/ParabolicManager.qml diff --git a/containment/package/contents/ui/ParabolicManager.qml b/containment/package/contents/ui/ParabolicManager.qml deleted file mode 100644 index c27ebf2b8..000000000 --- a/containment/package/contents/ui/ParabolicManager.qml +++ /dev/null @@ -1,202 +0,0 @@ -/* -* Copyright 2016 Smith AR -* Michail Vourlakos -* -* This file is part of Latte-Dock -* -* Latte-Dock is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* Latte-Dock is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -*/ - -import QtQuick 2.0 - -import org.kde.plasma.plasmoid 2.0 -import org.kde.plasma.core 2.0 as PlasmaCore - -// holds all the logic around parabolic effect signals into one place. -// ParabolicManager is responsible for triggering all the messages to applets -// that are neighbour to the hovered applet. This will help a lot to catch cases -// such as separator applets, hidden applets and proper clearing zoom. - -Item { - id: parManager - - property var hidden: [] - property var separators: [] - - // update the registered separators - // -1, no = add separator - // no, -1 = remove separator - // no, no = update separator position - function setSeparator(previousId, nextId) { - if (previousId === nextId && separators.indexOf(nextId)>-1) - return; - - //if (plasmoid.location === PlasmaCore.Types.BottomEdge) - // console.log("message: "+previousId + " - " + nextId); - - var update=false; - //should update - if (previousId>-1 && nextId>-1) - update=true; - - //remove - if ((previousId>-1 && nextId===-1) || update) { - var ind = separators.indexOf(previousId); - if (ind>-1) - separators.splice(ind,1); - } - - //add - if ((previousId===-1 && nextId>-1) || update) { - separators.push(nextId); - } - - //if (plasmoid.location === PlasmaCore.Types.BottomEdge) - // console.log("separators : "+separators); - - root.separatorsUpdated(); - } - - // update the registered hidden applets - // -1, no = add hidden - // no, -1 = remove hidden - // no, no = update hidden position - function setHidden(previousId, nextId) { - if (previousId === nextId && hidden.indexOf(nextId)>-1) - return; - - var update=false; - //should update - if (previousId>-1 && nextId>-1) - update=true; - - //remove - if ((previousId>-1 && nextId===-1) || update) { - var ind = hidden.indexOf(previousId); - if (ind>-1) - hidden.splice(ind,1); - } - - //add - if ((previousId===-1 && nextId>-1) || update) { - hidden.push(nextId); - } - - // console.log("hidden : "+hidden); - } - - function availableLowerId(from) { - var next = from; - - while (separators.indexOf(next) !== -1 - || hidden.indexOf(next) !== -1 - || (root.latteApplet && root.latteAppletPos===next && root.latteApplet.parabolicManager.firstRealTaskIndex === -1 )) - next = next - 1; - - return next; - } - - function availableHigherId(from) { - var next = from; - - while (separators.indexOf(next) !== -1 - || hidden.indexOf(next) !== -1 - || (root.latteApplet && root.latteAppletPos===next && root.latteApplet.parabolicManager.firstRealTaskIndex === -1 )) - next = next + 1; - - return next; - } - - function isSeparator(index){ - return (separators.indexOf(index) !== -1) - } - - function isHidden(index) { - return (hidden.indexOf(index) !== -1) - } - - //! the pseudo index applet after we take into account the separators before it, hidden applets, - //! spacers etc. for example the third applet if there is a separator before it is 1, it isnt 2 - function pseudoAppletIndex(realIndex) { - var counter = 0; - var originalAppletFound = false; - - for (var i=0; iroot.latteApplet.tasksBaseIndex && index<=lastTaskIndex); - } - - return false; - } - -} diff --git a/containment/package/contents/ui/applet/AppletItem.qml b/containment/package/contents/ui/applet/AppletItem.qml index a54fed301..29f921665 100644 --- a/containment/package/contents/ui/applet/AppletItem.qml +++ b/containment/package/contents/ui/applet/AppletItem.qml @@ -527,10 +527,6 @@ Item { return false; } - function refersEntryIndex(entryIndex) { - return (entryIndex === parabolicManager.pseudoAppletIndex(appletItem.index)); - } - ///END functions //BEGIN connections diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index 69843832a..421e6c3fb 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -385,7 +385,6 @@ Item { readonly property alias layouter: _layouter readonly property alias metrics: _metrics readonly property alias parabolic: _parabolic - readonly property alias parabolicManager: _parabolicManager readonly property alias maskManager: visibilityManager readonly property alias layoutsContainerItem: layoutsContainer @@ -1290,10 +1289,6 @@ Item { } } - ParabolicManager{ - id: _parabolicManager - } - Indicators.Manager{ id: indicators }