From 339b570c352f548a81c77c08c7464d6a81063c20 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 18 Sep 2017 19:06:25 +0300 Subject: [PATCH] fix #713,solid background for maximized windows --this works similar with transparency with no-maximized windows feature but on reverse. e.g. transparency for non-maximized windows and solidness for maximized ones --opacity to 1 when applet is active --when the user uses a semi transparent panel for un-maximized active windows and the user activates a pop up for an applet a better visual effect is the panel to not have any transparency --improve translation strings and options order --- containment/package/contents/config/main.xml | 3 +++ containment/package/contents/ui/PanelBox.qml | 4 +++- containment/package/contents/ui/main.qml | 6 +++++- .../contents/configuration/TweaksConfig.qml | 16 +++++++++++++++- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/containment/package/contents/config/main.xml b/containment/package/contents/config/main.xml index e9448e537..8ff18a756 100644 --- a/containment/package/contents/config/main.xml +++ b/containment/package/contents/config/main.xml @@ -72,6 +72,9 @@ false + + false + -1 diff --git a/containment/package/contents/ui/PanelBox.qml b/containment/package/contents/ui/PanelBox.qml index 9adb15ff6..556326f47 100644 --- a/containment/package/contents/ui/PanelBox.qml +++ b/containment/package/contents/ui/PanelBox.qml @@ -257,7 +257,9 @@ Item{ anchors.bottomMargin: Latte.WindowSystem.compositingActive ? shadowsSvgItem.margins.bottom - bottomIncreaser : 0 anchors.fill:parent - opacity: root.solidPanel ? 1 : plasmoid.configuration.panelTransparency / 100 + opacity: root.solidPanel || root.forceSolidPanel + || (root.hasExpandedApplet && root.zoomFactor===1 && plasmoid.configuration.panelSize===100) ? + 1 : plasmoid.configuration.panelTransparency / 100 property rect efGeometry: Qt.rect(-1,-1,0,0) diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index decf583a5..c30e5063e 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -68,6 +68,8 @@ DragDrop.DropArea { } property bool blurEnabled: plasmoid.configuration.blurEnabled && !root.forceTransparentPanel + || (hasExpandedApplet && zoomFactor===1 && plasmoid.configuration.panelSize===100) + property bool confirmedDragEntered: false property bool containsOnlyPlasmaTasks: false //this is flag to indicate when from tasks only a plasma based one is found property bool dockContainsMouse: dock && dock.visibility ? dock.visibility.containsMouse : false @@ -75,6 +77,7 @@ DragDrop.DropArea { property bool disablePanelShadowMaximized: plasmoid.configuration.disablePanelShadowForMaximized property bool drawShadowsExternal: panelShadowsActive && behaveAsPlasmaPanel property bool editMode: plasmoid.userConfiguring + property bool forceSolidPanel: plasmoid.configuration.solidBackgroundForMaximized && windowsModel.hasMaximizedWindow property bool forceTransparentPanel: root.backgroundOnlyOnMaximized && !windowsModel.hasMaximizedWindow && Latte.WindowSystem.compositingActive && !(hasExpandedApplet && zoomFactor===1 && plasmoid.configuration.panelSize===100) @@ -99,6 +102,7 @@ DragDrop.DropArea { property bool onlyAddingStarup: true //is used for the initialization phase in startup where there arent removals, this variable provides a way to grow icon size property bool shrinkThickMargins: plasmoid.configuration.shrinkThickMargins property bool solidPanel: Latte.WindowSystem.compositingActive ? plasmoid.configuration.solidPanel : true + //FIXME: possibly this is going to be the default behavior, this user choice //has been dropped from the Dock Configuration Window //property bool smallAutomaticIconJumps: plasmoid.configuration.smallAutomaticIconJumps @@ -1319,7 +1323,7 @@ DragDrop.DropArea { Loader{ id: windowsModel - active: (plasmoid.configuration.backgroundOnlyOnMaximized || root.disablePanelShadowMaximized) && dock + active: (plasmoid.configuration.backgroundOnlyOnMaximized || root.disablePanelShadowMaximized || plasmoid.configuration.solidBackgroundForMaximized) && dock property bool hasMaximizedWindow: active && item ? item.maximizedWindowOnScreen : false sourceComponent: WindowsModel{} diff --git a/shell/package/contents/configuration/TweaksConfig.qml b/shell/package/contents/configuration/TweaksConfig.qml index 25af188f5..c8896d1b4 100644 --- a/shell/package/contents/configuration/TweaksConfig.qml +++ b/shell/package/contents/configuration/TweaksConfig.qml @@ -84,10 +84,24 @@ PlasmaComponents.Page { } } + PlasmaComponents.CheckBox { + id: solidForMaximizedChk + Layout.leftMargin: units.smallSpacing * 2 + text: i18n("Force solid background for maximized windows") + checked: plasmoid.configuration.solidBackgroundForMaximized + tooltip: i18n("The panel background removes its transparency setting \n when there is a maximized window") + + onClicked: { + plasmoid.configuration.solidBackgroundForMaximized = checked; + // plasmoid.configuration.disablePanelShadowForMaximized = false; + // hideShadowsOnMaximizedChk.checked = false; + } + } + PlasmaComponents.CheckBox { id: onlyOnMaximizedChk Layout.leftMargin: units.smallSpacing * 2 - text: i18n("Show background only for maximized windows") + text: i18n("Hide background for not maximized windows") checked: plasmoid.configuration.backgroundOnlyOnMaximized tooltip: i18n("The panel background becomes transparent but is shown \nwhen there is a maximized window")