From 138343a9cd4a960f70825c07df49862295f19a8a Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 25 Feb 2019 20:03:28 +0200 Subject: [PATCH] improving Colors::FromTouching behavior --when a window is touching but this window is not active then the active color palette is preferred --- .../package/contents/ui/colorizer/Manager.qml | 38 +++++-------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/containment/package/contents/ui/colorizer/Manager.qml b/containment/package/contents/ui/colorizer/Manager.qml index 6f6716fe6..0451f222d 100644 --- a/containment/package/contents/ui/colorizer/Manager.qml +++ b/containment/package/contents/ui/colorizer/Manager.qml @@ -51,6 +51,14 @@ Loader{ } if (root.windowColors === Latte.Types.TouchingWindowColors && latteView.windowsTracker.touchingWindowScheme) { + //! we must track touching windows and when they are not ative + //! the active window scheme is used for convenience + if (latteView.windowsTracker.existsWindowTouching + && !latteView.windowsTracker.activeWindowTouching + && latteView.windowsTracker.activeWindowScheme) { + return latteView.windowsTracker.activeWindowScheme; + } + return latteView.windowsTracker.touchingWindowScheme; } } @@ -82,35 +90,9 @@ Loader{ property color applyColor: textColor - readonly property color backgroundColor: { - if (!root.hasExpandedApplet) { - //! we must track touching windows that are not active in order to paint our - //! contents with the disabled windows palette WHEN the active window is not touching our view - if (root.windowColors === Latte.Types.TouchingWindowColors - && latteView.windowsTracker.existsWindowTouching - && !latteView.windowsTracker.activeWindowTouching - && latteView.windowsTracker.touchingWindowScheme) { - return applyTheme.inactiveBackgroundColor; - } - } - - return applyTheme.backgroundColor; - } - - readonly property color textColor: { - if (!root.hasExpandedApplet) { - //! we must track touching windows that are not active in order to paint our - //! contents with the disabled windows palette WHEN the active window is not touching our view - if (root.windowColors === Latte.Types.TouchingWindowColors - && latteView.windowsTracker.existsWindowTouching - && !latteView.windowsTracker.activeWindowTouching - && latteView.windowsTracker.touchingWindowScheme) { - return applyTheme.inactiveTextColor; - } - } + readonly property color backgroundColor:applyTheme.backgroundColor + readonly property color textColor: applyTheme.textColor - return applyTheme.textColor; - } readonly property color inactiveBackgroundColor: applyTheme === theme ? theme.backgroundColor : applyTheme.inactiveBackgroundColor readonly property color inactiveTextColor: applyTheme === theme ? theme.textColor : applyTheme.inactiveTextColor