From 790e0af406ac88b15cbadd00be94a53656e89b79 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 24 Apr 2020 13:50:08 +0300 Subject: [PATCH] add Containment.ThemeColorsGroup enum --- containment/package/contents/ui/VisibilityManager.qml | 3 ++- containment/package/contents/ui/colorizer/Manager.qml | 10 +++++----- containment/package/contents/ui/main.qml | 4 ++-- containment/plugin/types.h | 8 ++++++++ .../contents/configuration/pages/AppearanceConfig.qml | 6 +++--- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/containment/package/contents/ui/VisibilityManager.qml b/containment/package/contents/ui/VisibilityManager.qml index 6ca03b11d..4d12b77e2 100644 --- a/containment/package/contents/ui/VisibilityManager.qml +++ b/containment/package/contents/ui/VisibilityManager.qml @@ -25,6 +25,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore 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 Item{ id: manager @@ -340,7 +341,7 @@ Item{ || ((root.backgroundOnlyOnMaximized /*Dynamic Background */ || plasmoid.configuration.solidBackgroundForMaximized || root.disablePanelShadowMaximized - || root.windowColors !== LatteCore.Types.NoneWindowColors)) + || root.windowColors !== LatteContainment.Types.NoneWindowColors)) || (root.screenEdgeMarginsEnabled /*Dynamic Screen Edge Margin*/ && plasmoid.configuration.hideScreenGapForMaximized) } diff --git a/containment/package/contents/ui/colorizer/Manager.qml b/containment/package/contents/ui/colorizer/Manager.qml index 88b4684cc..b98344a7f 100644 --- a/containment/package/contents/ui/colorizer/Manager.qml +++ b/containment/package/contents/ui/colorizer/Manager.qml @@ -66,9 +66,9 @@ Loader{ readonly property real currentBackgroundBrightness: item ? item.currentBrightness : -1000 - readonly property bool applyingWindowColors: (root.windowColors === LatteCore.Types.ActiveWindowColors && latteView && latteView.windowsTracker + readonly property bool applyingWindowColors: (root.windowColors === LatteContainment.Types.ActiveWindowColors && latteView && latteView.windowsTracker && selectedWindowsTracker.activeWindowScheme) - || (root.windowColors === LatteCore.Types.TouchingWindowColors && latteView && latteView.windowsTracker + || (root.windowColors === LatteContainment.Types.TouchingWindowColors && latteView && latteView.windowsTracker && latteView.windowsTracker.currentScreen.touchingWindowScheme) property QtObject applyTheme: { @@ -77,11 +77,11 @@ Loader{ } if (latteView && latteView.windowsTracker && !root.hasExpandedApplet) { - if (root.windowColors === LatteCore.Types.ActiveWindowColors && selectedWindowsTracker.activeWindowScheme) { + if (root.windowColors === LatteContainment.Types.ActiveWindowColors && selectedWindowsTracker.activeWindowScheme) { return selectedWindowsTracker.activeWindowScheme; } - if (root.windowColors === LatteCore.Types.TouchingWindowColors && latteView.windowsTracker.currentScreen.touchingWindowScheme) { + if (root.windowColors === LatteContainment.Types.TouchingWindowColors && latteView.windowsTracker.currentScreen.touchingWindowScheme) { //! we must track touching windows and when they are not ative //! the active window scheme is used for convenience if (latteView.windowsTracker.currentScreen.existsWindowTouching @@ -98,7 +98,7 @@ Loader{ if (root.userShowPanelBackground && root.plasmaBackgroundForPopups && root.hasExpandedApplet /*for expanded popups when it is enabled*/ || root.plasmaStyleBusyForTouchingBusyVerticalView || (root.themeColors === LatteContainment.Types.SmartThemeColors /*for Smart theming that Windows colors are not used and the user wants solidness at some cases*/ - && root.windowColors === LatteCore.Types.NoneWindowColors + && root.windowColors === LatteContainment.Types.NoneWindowColors && root.forceSolidPanel) ) { /* plasma style*/ return theme; diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index bd3e7cbbd..35f5c911d 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -158,7 +158,7 @@ Item { && !inConfigureAppletsMode && !forceSolidPanel && !latteView.windowsTracker.currentScreen.existsWindowTouching - && !(windowColors === LatteCore.Types.ActiveWindowColors && selectedWindowsTracker.existsWindowActive) + && !(windowColors === LatteContainment.Types.ActiveWindowColors && selectedWindowsTracker.existsWindowActive) property bool forcePanelForBusyBackground: userShowPanelBackground && (root.themeColors === LatteContainment.Types.SmartThemeColors) && ( (root.forceTransparentPanel && colorizerManager.backgroundIsBusy) @@ -203,7 +203,7 @@ Item { property int themeColors: plasmoid.configuration.themeColors property int windowColors: plasmoid.configuration.windowColors - property bool colorizerEnabled: themeColors !== LatteContainment.Types.PlasmaThemeColors || windowColors !== LatteCore.Types.NoneWindowColors + property bool colorizerEnabled: themeColors !== LatteContainment.Types.PlasmaThemeColors || windowColors !== LatteContainment.Types.NoneWindowColors property bool plasmaBackgroundForPopups: plasmoid.configuration.plasmaBackgroundForPopups diff --git a/containment/plugin/types.h b/containment/plugin/types.h index 28cffe9c6..85b68086b 100644 --- a/containment/plugin/types.h +++ b/containment/plugin/types.h @@ -62,6 +62,14 @@ public: }; Q_ENUM(ThemeColorsGroup); + enum WindowColorsGroup + { + NoneWindowColors = 0, + ActiveWindowColors, + TouchingWindowColors + }; + Q_ENUM(WindowColorsGroup); + enum ActiveWindowFilterGroup { ActiveInCurrentScreen = 0, diff --git a/shell/package/contents/configuration/pages/AppearanceConfig.qml b/shell/package/contents/configuration/pages/AppearanceConfig.qml index 968d73c16..bbf468285 100644 --- a/shell/package/contents/configuration/pages/AppearanceConfig.qml +++ b/shell/package/contents/configuration/pages/AppearanceConfig.qml @@ -796,7 +796,7 @@ PlasmaComponents.Page { exclusiveGroup: windowColorsGroup tooltip: i18n("Colors are not going to be based on any window") - readonly property int colors: LatteCore.Types.NoneWindowColors + readonly property int colors: LatteContainment.Types.NoneWindowColors } PlasmaComponents.Button { @@ -810,7 +810,7 @@ PlasmaComponents.Page { i18n("Colors are going to be based on the active window") : i18n("Colors are going to be based on the active window.\nNotice: For optimal experience you are advised to install Colors KWin Script from KDE Store") - readonly property int colors: LatteCore.Types.ActiveWindowColors + readonly property int colors: LatteContainment.Types.ActiveWindowColors PlasmaCore.IconItem { anchors.right: parent.right @@ -835,7 +835,7 @@ PlasmaComponents.Page { i18n("Colors are going to be based on windows that are touching the view") : i18n("Colors are going to be based on windows that are touching the view.\nNotice: For optimal experience you are advised to install Colors KWin Script from KDE Store") - readonly property int colors: LatteCore.Types.TouchingWindowColors + readonly property int colors: LatteContainment.Types.TouchingWindowColors PlasmaCore.IconItem { anchors.right: parent.right