From 39fbf728d5526f9e83832a55e399383d15cff8cd Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 24 Apr 2020 12:46:41 +0300 Subject: [PATCH] rename actions for LatteContainment.scrollActions --- .../ui/layouts/EnvironmentActions.qml | 16 ++++++++------- .../contents/ui/layouts/LayoutsContainer.qml | 3 ++- .../contents/ui/layouts/loaders/Tasks.qml | 3 ++- containment/plugin/types.h | 10 ++++++++++ .../package/contents/ui/task/TaskItem.qml | 2 +- .../configuration/pages/BehaviorConfig.qml | 20 +++++++++---------- .../contents/controls/TypeSelection.qml | 3 ++- 7 files changed, 36 insertions(+), 21 deletions(-) diff --git a/containment/package/contents/ui/layouts/EnvironmentActions.qml b/containment/package/contents/ui/layouts/EnvironmentActions.qml index 78ae527d0..d3974c7bf 100644 --- a/containment/package/contents/ui/layouts/EnvironmentActions.qml +++ b/containment/package/contents/ui/layouts/EnvironmentActions.qml @@ -24,6 +24,8 @@ import org.kde.plasma.plasmoid 2.0 import org.kde.latte.core 0.2 as LatteCore +import org.kde.latte.private.containment 0.1 as LatteContainment + import "loaders" as Loaders import "indicator" as Indicator import "../applet/indicator" as AppletIndicator @@ -124,7 +126,7 @@ Loader { return; } - if (root.scrollAction === LatteCore.Types.ScrollNone) { + if (root.scrollAction === LatteContainment.Types.ScrollNone) { root.emptyAreasWheel(wheel); return; } @@ -146,11 +148,11 @@ Loader { if (angle>10) { //! upwards - if (root.scrollAction === LatteCore.Types.ScrollDesktops) { + if (root.scrollAction === LatteContainment.Types.ScrollDesktops) { latteView.windowsTracker.switchToPreviousVirtualDesktop(); - } else if (root.scrollAction === LatteCore.Types.ScrollActivities) { + } else if (root.scrollAction === LatteContainment.Types.ScrollActivities) { latteView.windowsTracker.switchToPreviousActivity(); - } else if (root.scrollAction === LatteCore.Types.ScrollToggleMinimized) { + } else if (root.scrollAction === LatteContainment.Types.ScrollToggleMinimized) { if (!ctrlPressed) { tasksLoader.item.activateNextPrevTask(true); } else if (!selectedWindowsTracker.lastActiveWindow.isMaximized){ @@ -161,11 +163,11 @@ Loader { } } else if (angle<-10) { //! downwards - if (root.scrollAction === LatteCore.Types.ScrollDesktops) { + if (root.scrollAction === LatteContainment.Types.ScrollDesktops) { latteView.windowsTracker.switchToNextVirtualDesktop(); - } else if (root.scrollAction === LatteCore.Types.ScrollActivities) { + } else if (root.scrollAction === LatteContainment.Types.ScrollActivities) { latteView.windowsTracker.switchToNextActivity(); - } else if (root.scrollAction === LatteCore.Types.ScrollToggleMinimized) { + } else if (root.scrollAction === LatteContainment.Types.ScrollToggleMinimized) { if (!ctrlPressed) { if (selectedWindowsTracker.lastActiveWindow.isValid && !selectedWindowsTracker.lastActiveWindow.isMinimized diff --git a/containment/package/contents/ui/layouts/LayoutsContainer.qml b/containment/package/contents/ui/layouts/LayoutsContainer.qml index 2ec0e0d06..2321bd2dd 100644 --- a/containment/package/contents/ui/layouts/LayoutsContainer.qml +++ b/containment/package/contents/ui/layouts/LayoutsContainer.qml @@ -26,6 +26,7 @@ import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.latte.core 0.2 as LatteCore +import org.kde.latte.private.containment 0.1 as LatteContainment import "../../code/HeuristicTools.js" as HeuristicTools @@ -183,7 +184,7 @@ Item{ onYChanged: root.updateEffectsArea(); EnvironmentActions { - active: root.scrollAction !== LatteCore.Types.ScrollNone || root.dragActiveWindowEnabled || root.closeActiveWindowEnabled + active: root.scrollAction !== LatteContainment.Types.ScrollNone || root.dragActiveWindowEnabled || root.closeActiveWindowEnabled alignment: _mainLayout.alignment } diff --git a/containment/package/contents/ui/layouts/loaders/Tasks.qml b/containment/package/contents/ui/layouts/loaders/Tasks.qml index 680be7f1f..3e144f62c 100644 --- a/containment/package/contents/ui/layouts/loaders/Tasks.qml +++ b/containment/package/contents/ui/layouts/loaders/Tasks.qml @@ -22,10 +22,11 @@ import QtQuick 2.7 import org.kde.taskmanager 0.1 as TaskManager import org.kde.latte.core 0.2 as LatteCore +import org.kde.latte.private.containment 0.1 as LatteContainment Loader { id: tasksLoader - active: root.scrollAction === LatteCore.Types.ScrollTasks || root.scrollAction === LatteCore.Types.ScrollToggleMinimized + active: root.scrollAction === LatteContainment.Types.ScrollTasks || root.scrollAction === LatteContainment.Types.ScrollToggleMinimized sourceComponent: Item { TaskManager.TasksModel { id: tasksModel diff --git a/containment/plugin/types.h b/containment/plugin/types.h index bb992845f..9ad60cdce 100644 --- a/containment/plugin/types.h +++ b/containment/plugin/types.h @@ -36,6 +36,16 @@ public: Types() = delete; ~Types() {} + enum ScrollAction + { + ScrollNone = 0, + ScrollDesktops, + ScrollActivities, + ScrollTasks, + ScrollToggleMinimized + }; + Q_ENUM(ScrollAction); + enum ActiveWindowFilterGroup { ActiveInCurrentScreen = 0, diff --git a/plasmoid/package/contents/ui/task/TaskItem.qml b/plasmoid/package/contents/ui/task/TaskItem.qml index e83337d2d..486751c57 100644 --- a/plasmoid/package/contents/ui/task/TaskItem.qml +++ b/plasmoid/package/contents/ui/task/TaskItem.qml @@ -904,7 +904,7 @@ MouseArea{ } onWheel: { - var wheelActionsEnabled = (root.taskScrollAction !== LatteCore.Types.ScrollNone || manualScrollTasksEnabled); + var wheelActionsEnabled = (root.taskScrollAction !== LatteTasks.Types.ScrollNone || manualScrollTasksEnabled); if (isSeparator || wheelIsBlocked diff --git a/shell/package/contents/configuration/pages/BehaviorConfig.qml b/shell/package/contents/configuration/pages/BehaviorConfig.qml index a84329b57..fe242d03a 100644 --- a/shell/package/contents/configuration/pages/BehaviorConfig.qml +++ b/shell/package/contents/configuration/pages/BehaviorConfig.qml @@ -660,20 +660,20 @@ PlasmaComponents.Page { onCurrentIndexChanged: { switch(currentIndex) { - case LatteCore.Types.ScrollNone: - plasmoid.configuration.scrollAction = LatteCore.Types.ScrollNone; + case LatteContainment.Types.ScrollNone: + plasmoid.configuration.scrollAction = LatteContainment.Types.ScrollNone; break; - case LatteCore.Types.ScrollDesktops: - plasmoid.configuration.scrollAction = LatteCore.Types.ScrollDesktops; + case LatteContainment.Types.ScrollDesktops: + plasmoid.configuration.scrollAction = LatteContainment.Types.ScrollDesktops; break; - case LatteCore.Types.ScrollActivities: - plasmoid.configuration.scrollAction = LatteCore.Types.ScrollActivities; + case LatteContainment.Types.ScrollActivities: + plasmoid.configuration.scrollAction = LatteContainment.Types.ScrollActivities; break; - case LatteCore.Types.ScrollTasks: - plasmoid.configuration.scrollAction = LatteCore.Types.ScrollTasks; + case LatteContainment.Types.ScrollTasks: + plasmoid.configuration.scrollAction = LatteContainment.Types.ScrollTasks; break; - case LatteCore.Types.ScrollToggleMinimized: - plasmoid.configuration.scrollAction = LatteCore.Types.ScrollToggleMinimized; + case LatteContainment.Types.ScrollToggleMinimized: + plasmoid.configuration.scrollAction = LatteContainment.Types.ScrollToggleMinimized; break; } } diff --git a/shell/package/contents/controls/TypeSelection.qml b/shell/package/contents/controls/TypeSelection.qml index 6897df566..7c6521220 100644 --- a/shell/package/contents/controls/TypeSelection.qml +++ b/shell/package/contents/controls/TypeSelection.qml @@ -29,6 +29,7 @@ import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.plasmoid 2.0 import org.kde.latte.core 0.2 as LatteCore +import org.kde.latte.private.containment 0.1 as LatteContainment Grid { id: typeRow @@ -82,7 +83,7 @@ Grid { //! Empty Areas plasmoid.configuration.dragActiveWindowEnabled = false; - plasmoid.configuration.scrollAction = LatteCore.Types.ScrollNone; + plasmoid.configuration.scrollAction = LatteContainment.Types.ScrollNone; //! Animations plasmoid.configuration.animationLauncherBouncing = true;