diff --git a/containment/package/contents/ui/PanelBox.qml b/containment/package/contents/ui/PanelBox.qml index 6887a660c..e881ae83d 100644 --- a/containment/package/contents/ui/PanelBox.qml +++ b/containment/package/contents/ui/PanelBox.qml @@ -503,13 +503,17 @@ Item{ Colorizer.CustomBackground { id: overlayedBackground anchors.fill: solidBackground + + readonly property bool busyBackground: root.forcePanelForBusyBackground + && (solidBackground.opacity === 0 || !solidBackground.paintInstantly) + readonly property bool coloredView: colorizerManager.mustBeShown && colorizerManager.applyTheme !== theme + opacity: { - if (root.forcePanelForBusyBackground - && (solidBackground.opacity === 0 || !solidBackground.paintInstantly)) { + if (busyBackground) { return plasmoid.configuration.panelTransparency / 100; } - if (colorizerManager.mustBeShown && colorizerManager.applyTheme !== theme) { + if (coloredView) { return midOpacity; } @@ -517,7 +521,7 @@ Item{ } backgroundColor: { - if (colorizerManager.mustBeShown && colorizerManager.applyTheme !== theme) { + if (busyBackground || coloredView) { return colorizerManager.backgroundColor; } diff --git a/containment/package/contents/ui/colorizer/Manager.qml b/containment/package/contents/ui/colorizer/Manager.qml index d8862fe62..7ab2fef2b 100644 --- a/containment/package/contents/ui/colorizer/Manager.qml +++ b/containment/package/contents/ui/colorizer/Manager.qml @@ -60,7 +60,8 @@ Loader{ readonly property bool editModeTextColorIsBright: ColorizerTools.colorBrightness(editModeTextColor) > 127.5 readonly property color editModeTextColor: latteView && latteView.layout ? latteView.layout.textColor : "white" - readonly property bool mustBeShown: (applyTheme && applyTheme !== theme) || (root.inConfigureAppletsMode && (root.themeColors === Latte.Types.SmartThemeColors)) + readonly property bool mustBeShown: (applyTheme && applyTheme !== theme) + || (root.inConfigureAppletsMode && (root.themeColors === Latte.Types.SmartThemeColors)) readonly property real currentBackgroundBrightness: item ? item.currentBrightness : -1000 @@ -102,10 +103,25 @@ Loader{ } if (root.themeColors === Latte.Types.SmartThemeColors) { - if (currentBackgroundBrightness > 127.5) { - return themeExtended.lightTheme; + //! Smart Colors Case + if (!root.forcePanelForBusyBackground) { + //! simple case that not a busy background is applied + return currentBackgroundBrightness > 127.5 ? themeExtended.lightTheme : themeExtended.darkTheme; } else { - return themeExtended.darkTheme; + //! Smart + Busy background case + var themeContrastedTextColor = currentBackgroundBrightness > 127.5 ? themeExtended.lightTheme : themeExtended.darkTheme; + var themeContrastedBackground = currentBackgroundBrightness > 127.5 ? themeExtended.darkTheme : themeExtended.lightTheme; + + if (root.panelTransparency < 35) { + //! textColor should be better to provide the needed contrast + return themeContrastedTextColor; + } else if (root.panelTransparency >= 35 && root.panelTransparency <= 70) { + //! provide a dark case scenario at all cases + return themeExtended.darkTheme; + } else { + //! default plasma theme shoud be better for panel transparency > 70 + return theme; + } } } } diff --git a/containment/package/contents/ui/editmode/SettingsOverlay.qml b/containment/package/contents/ui/editmode/SettingsOverlay.qml index 1e3b3857e..12bb9a08f 100644 --- a/containment/package/contents/ui/editmode/SettingsOverlay.qml +++ b/containment/package/contents/ui/editmode/SettingsOverlay.qml @@ -51,14 +51,19 @@ Item{ readonly property real textColorBrightness: ColorizerTools.colorBrightness(textColor) readonly property bool textColorIsDark: textColorBrightness < 127.5 - readonly property color textColor: { - if (imageTiler.opacity <= 0.4) { - return colorizerManager.applyColor; - } else { - return latteView && latteView.layout ? latteView.layout.textColor : "#D7E3FF"; + + readonly property color bestContrastedTextColor: { + if (imageTiler.opacity <= 0.4 && !root.inConfigureAppletsMode && themeExtended) { + return colorizerManager.currentBackgroundBrightness > 127.5 ? + themeExtended.lightTheme.textColor : + themeExtended.darkTheme.textColor; } + + return latteView && latteView.layout ? latteView.layout.textColor : "#D7E3FF"; } + readonly property color textColor: bestContrastedTextColor + layer.enabled: true layer.effect: DropShadow{ radius: settingsRoot.textShadow diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index 1abdd4516..5ec431acf 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -144,8 +144,10 @@ Item { && !(windowColors === Latte.Types.TouchingWindowColors && latteView.windowsTracker.currentScreen.activeWindowTouching) && !(windowColors === Latte.Types.ActiveWindowColors && selectedWindowsTracker.existsWindowActive) - property bool forcePanelForBusyBackground: userShowPanelBackground && root.forceTransparentPanel - && colorizerManager.mustBeShown && colorizerManager.backgroundIsBusy + property bool forcePanelForBusyBackground: userShowPanelBackground + && root.forceTransparentPanel + && (root.themeColors === Latte.Types.SmartThemeColors) + && colorizerManager.backgroundIsBusy property int themeColors: plasmoid.configuration.themeColors property int windowColors: plasmoid.configuration.windowColors