diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index 7b84409b6..dcce83b77 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -85,6 +85,12 @@ DragDrop.DropArea { property bool disablePanelShadowMaximized: plasmoid.configuration.disablePanelShadowForMaximized && Latte.WindowSystem.compositingActive property bool drawShadowsExternal: panelShadowsActive && behaveAsPlasmaPanel && !visibilityManager.inTempHiding property bool editMode: editModeVisual.inEditMode + property bool windowIsTouching: dock && dock.visibility && (dock.visibility.existsWindowMaximized || dock.visibility.existsWindowSnapped || hasExpandedApplet) + + property bool forceSemiTransparentPanel: ((!plasmoid.configuration.solidBackgroundForMaximized && plasmoid.configuration.backgroundOnlyOnMaximized && windowIsTouching) + || (plasmoid.configuration.solidBackgroundForMaximized && !plasmoid.configuration.backgroundOnlyOnMaximized && !windowIsTouching)) + && Latte.WindowSystem.compositingActive + property bool forceSolidPanel: plasmoid.configuration.solidBackgroundForMaximized && dock && dock.visibility && Latte.WindowSystem.compositingActive &&(dock.visibility.existsWindowMaximized || dock.visibility.existsWindowSnapped || hasExpandedApplet) @@ -93,7 +99,7 @@ DragDrop.DropArea { && Latte.WindowSystem.compositingActive && !(hasExpandedApplet && zoomFactor===1 && plasmoid.configuration.panelSize===100) - property bool forceColorizer: plasmoid.configuration.colorizeTransparentPanels + property bool forceColorizer: Latte.WindowSystem.compositingActive && plasmoid.configuration.colorizeTransparentPanels readonly property bool hasExpandedApplet: plasmoid.applets.some(function (item) { return (item.status >= PlasmaCore.Types.NeedsAttentionStatus && item.pluginName !== root.plasmoidName @@ -1744,7 +1750,12 @@ DragDrop.DropArea { readonly property real themeBackgroundColorLuma: 0.2126*backColorRs + 0.7152*backColorGs + 0.0722*backColorBs readonly property real themeTextColorLuma: 0.2126*textColorRs + 0.7152*textColorGs + 0.0722*textColorBs - property bool isShown: active && !forceSolidPanel && plasmoid.configuration.solidBackgroundForMaximized && !root.editMode && Latte.WindowSystem.compositingActive + property bool isShown: active && !forceSolidPanel + //! when forceSemiTransparentPanel is enabled because of snapped or maximized etc. windows + //! then the colorizer could be enabled for low panel transparency levels (<40%) + && (!forceSemiTransparentPanel || (forceSemiTransparentPanel && root.panelTransparency<40)) + && (plasmoid.configuration.solidBackgroundForMaximized || plasmoid.configuration.backgroundOnlyOnMaximized) + && !root.editMode && Latte.WindowSystem.compositingActive property real currentBackgroundLuminas: -1000 diff --git a/shell/package/contents/configuration/TweaksConfig.qml b/shell/package/contents/configuration/TweaksConfig.qml index e7eecb4ac..c1b1b6b55 100644 --- a/shell/package/contents/configuration/TweaksConfig.qml +++ b/shell/package/contents/configuration/TweaksConfig.qml @@ -110,6 +110,18 @@ PlasmaComponents.Page { } } + PlasmaComponents.CheckBox { + id: onlyOnMaximizedChk + Layout.leftMargin: units.smallSpacing * 2 + text: i18n("Hide background for not maximized windows") + checked: plasmoid.configuration.backgroundOnlyOnMaximized + tooltip: i18n("The panel background becomes transparent except if \nthere is a maximized or snapped window") + + onClicked: { + plasmoid.configuration.backgroundOnlyOnMaximized = checked; + } + } + PlasmaComponents.CheckBox { id: colorizeTransparentPanelsChk Layout.leftMargin: units.smallSpacing * 2 @@ -120,25 +132,13 @@ PlasmaComponents.Page { tooltip: i18n("The panel contents are colorized in order to improve contrast \nwith the underlying desktop background when the panel is transparent") style: LatteCheckBoxStyle{} - enabled: solidForMaximizedChk.checked + enabled: solidForMaximizedChk.checked || onlyOnMaximizedChk.checked onClicked: { plasmoid.configuration.colorizeTransparentPanels = checked; } } - PlasmaComponents.CheckBox { - id: onlyOnMaximizedChk - Layout.leftMargin: units.smallSpacing * 2 - text: i18n("Hide background for not maximized windows") - checked: plasmoid.configuration.backgroundOnlyOnMaximized - tooltip: i18n("The panel background becomes transparent except if \nthere is a maximized or snapped window") - - onClicked: { - plasmoid.configuration.backgroundOnlyOnMaximized = checked; - } - } - PlasmaComponents.CheckBox { id: hideShadowsOnMaximizedChk Layout.leftMargin: units.smallSpacing * 2