improve more the isBusy background case

--the new implementation supports and always darkish
case when the isBusy background is drawn. So now
we have the following possibilities:
a)panel transparency<35 means BEST contrast with
underlying desktop background
b)panel transparency>=35 AND <70 means a DARKISH
background
c)panel transparency>=70 the user chosen plasma
theme
pull/8/head
Michail Vourlakos 6 years ago
parent 6cd1a9b7ae
commit ed83d1d13c

@ -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;
}

@ -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;
}
}
}
}

@ -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

@ -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

Loading…
Cancel
Save