simplify colorize properties & active new options

pull/4/head
Michail Vourlakos 6 years ago
parent 730030c5fb
commit fd300ec9cf

@ -522,7 +522,7 @@ Item{
return plasmoid.configuration.panelTransparency / 100;
}
if (root.forceColorizeFromActiveWindowScheme) {
if (colorizerManager.mustBeShown && colorizerManager.applyTheme !== theme) {
return solidBackground.opacity;
}
@ -530,14 +530,10 @@ Item{
}
backgroundColor: {
if (root.forcePanelForBusyBackground) {
if (colorizerManager.mustBeShown && colorizerManager.applyTheme !== theme) {
return colorizerManager.backgroundColor;
}
if (root.forceColorizeFromActiveWindowScheme) {
return latteView.windowsTracker.touchingWindowScheme.backgroundColor
}
return "transparent";
}

@ -516,6 +516,7 @@ Item {
readonly property bool mustBeShown: colorizerManager.mustBeShown
&& !appletItem.userBlocksColorizing
&& !appletItem.appletBlocksColorizing
&& !appletItem.isInternalViewSplitter
Behavior on opacity {
NumberAnimation {

@ -29,40 +29,43 @@ import "../../code/ColorizerTools.js" as ColorizerTools
Loader{
id: manager
active: root.colorizerEnabled || forceSolidnessAndColorize
readonly property bool forceSolidness: (root.solidStylePanel && !plasmoid.configuration.solidBackgroundForMaximized)
|| root.forceSolidPanel
|| !Latte.WindowSystem.compositingActive
readonly property bool forceSolidnessAndColorize: forceSolidness && forceColorizeFromActiveWindowScheme
//! the loader loads the backgroundTracker component
active: root.themeColors === Latte.Types.SmartThemeColors
readonly property bool backgroundIsBusy: item ? item.isBusy : false
readonly property real themeBackgroundColorBrightness: ColorizerTools.colorBrightness(theme.backgroundColor)
readonly property real themeTextColorBrightness: ColorizerTools.colorBrightness(theme.textColor)
readonly property color minimizedDotColor: themeTextColorBrightness > 127.5 ? Qt.darker(theme.textColor, 1.7) : Qt.lighter(theme.textColor, 7)
property bool mustBeShown: active && (!root.forceSolidPanel || forceSolidnessAndColorize)
//! when forceSemiTransparentPanel is enabled because of touching or maximized etc. windows
//! then the colorizer could be enabled for low panel transparency levels (<40%)
&& (!userShowPanelBackground || !forceSemiTransparentPanel || (forceSemiTransparentPanel && root.panelTransparency<40))
&& !maximizedWindowTitleBarBehavesAsPanelBackground
&& (plasmoid.configuration.solidBackgroundForMaximized || plasmoid.configuration.backgroundOnlyOnMaximized)
&& !root.editMode && Latte.WindowSystem.compositingActive
readonly property bool mustBeShown: (applyTheme && applyTheme !== theme)
onMustBeShownChanged: console.log(mustBeShown);
readonly property real currentBackgroundBrightness: item ? item.currentBrightness : -1000
readonly property bool applyingWindowColors: (root.windowColors === Latte.Types.ActiveWindowColors && latteView.windowsTracker.activeWindowScheme)
|| (root.windowColors === Latte.Types.TouchingWindowColors && latteView.windowsTracker.touchingWindowScheme)
property QtObject applyTheme: {
if (forceSolidnessAndColorize && latteView.windowsTracker.touchingWindowScheme) {
if (root.windowColors === Latte.Types.ActiveWindowColors && latteView.windowsTracker.activeWindowScheme) {
return latteView.windowsTracker.activeWindowScheme;
}
if (root.windowColors === Latte.Types.TouchingWindowColors && latteView.windowsTracker.touchingWindowScheme) {
return latteView.windowsTracker.touchingWindowScheme;
}
if (themeExtended) {
if (currentBackgroundBrightness > 127.5) {
return themeExtended.lightTheme;
} else {
return themeExtended.darkTheme;
if (root.themeColors === Latte.Types.ReverseThemeColors) {
return themeExtended.isLightTheme ? themeExtended.darkTheme : themeExtended.lightTheme;
}
if (root.themeColors === Latte.Types.SmartThemeColors && !root.editMode) {
if (currentBackgroundBrightness > 127.5) {
return themeExtended.lightTheme;
} else {
return themeExtended.darkTheme;
}
}
}

@ -90,10 +90,6 @@ DragDrop.DropArea {
property bool windowIsTouching: latteView && latteView.windowsTracker
&& (latteView.windowsTracker.existsWindowMaximized|| latteView.windowsTracker.activeWindowTouching || hasExpandedApplet)
property bool forceSemiTransparentPanel: Latte.WindowSystem.compositingActive && !root.editMode
&& ((!plasmoid.configuration.solidBackgroundForMaximized && plasmoid.configuration.backgroundOnlyOnMaximized && windowIsTouching)
|| (plasmoid.configuration.solidBackgroundForMaximized && !plasmoid.configuration.backgroundOnlyOnMaximized && !windowIsTouching))
property bool forceSolidPanel: (latteView && latteView.visibility
&& Latte.WindowSystem.compositingActive
&& !root.editMode
@ -111,21 +107,13 @@ DragDrop.DropArea {
property bool forcePanelForBusyBackground: root.forceTransparentPanel && colorizerManager.mustBeShown && colorizerManager.backgroundIsBusy
property bool themeColors: plasmoid.configuration.themeColors
property bool windowColors: plasmoid.configuration.windowColors
property int themeColors: plasmoid.configuration.themeColors
property int windowColors: plasmoid.configuration.windowColors
property bool colorizerEnabled: themeColors !== Latte.Types.PlasmaThemeColors || windowColors !== Latte.Types.NoneWindowColors
property bool plasmaBackgroundForPopups: plasmoid.configuration.plasmaBackgroundForPopups
property bool maximizedWindowTitleBarBehavesAsPanelBackground: latteView && latteView.visibility
&& (!plasmoid.configuration.solidBackgroundForMaximized && plasmoid.configuration.backgroundOnlyOnMaximized)
&& (latteView.visibility.mode === Latte.Types.WindowsGoBelow)
&& (plasmoid.location === PlasmaCore.Types.TopEdge)
&& (!useThemePanel || panelTransparency<40)
&& latteView.windowsTracker.existsWindowMaximized
readonly property bool hasExpandedApplet: plasmoid.applets.some(function (item) {
return (item.status >= PlasmaCore.Types.NeedsAttentionStatus && item.status !== PlasmaCore.Types.HiddenStatus
&& item.pluginName !== root.plasmoidName

Loading…
Cancel
Save