From 162d84e31d85d3b76f522400b02f8b4c4a05ec9d Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 27 May 2017 20:40:23 +0300 Subject: [PATCH] fix #495,Disable panel shadow for maximized windows --- containment/package/contents/config/main.xml | 3 +++ containment/package/contents/ui/main.qml | 12 ++++++++---- .../contents/configuration/TweaksConfig.qml | 17 ++++++++++++++++- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/containment/package/contents/config/main.xml b/containment/package/contents/config/main.xml index cac3e02f0..320618d70 100644 --- a/containment/package/contents/config/main.xml +++ b/containment/package/contents/config/main.xml @@ -48,6 +48,9 @@ true + + false + 100 diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index ea5c153e2..7d3119e16 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -69,7 +69,7 @@ DragDrop.DropArea { property bool confirmedDragEntered: false property bool dockContainsMouse: dock && dock.visibility ? dock.visibility.containsMouse : false - + property bool disablePanelShadowMaximized: plasmoid.configuration.disablePanelShadowForMaximized property bool drawShadowsExternal: panelShadowsActive && behaveAsPlasmaPanel property bool editMode: plasmoid.userConfiguring property bool exposeAltSession: globalSettings ? globalSettings.exposeAltSession : false @@ -131,8 +131,11 @@ DragDrop.DropArea { property int panelEdgeSpacing: iconSize / 3 property int panelTransparency: plasmoid.configuration.panelTransparency - property bool panelShadowsActive: (plasmoid.configuration.panelShadows && !root.backgroundOnlyOnMaximized) - || (plasmoid.configuration.panelShadows && root.backgroundOnlyOnMaximized && !root.forceTransparentPanel) + property bool panelShadowsActive: ( (plasmoid.configuration.panelShadows && !root.backgroundOnlyOnMaximized) + || (plasmoid.configuration.panelShadows && root.backgroundOnlyOnMaximized && !root.forceTransparentPanel)) + && !(disablePanelShadowMaximized && windowsModel.hasMaximizedWindow) + + property int totalPanelEdgeSpacing: 0 //this is set by PanelBox //FIXME: this is not needed any more probably @@ -217,6 +220,7 @@ DragDrop.DropArea { // TO BE DELETED, if not needed: property int counter:0; ///BEGIN properties provided to Latte Plasmoid + //shadows for applets, it should be removed as the appleitems dont need it any more property bool enableShadows: plasmoid.configuration.shadows || root.forceTransparentPanel property bool dockIsHidden: dock ? dock.visibility.isHidden : true property bool dotsOnActive: plasmoid.configuration.dotsOnActive @@ -1164,7 +1168,7 @@ DragDrop.DropArea { Loader{ id: windowsModel - active: plasmoid.configuration.backgroundOnlyOnMaximized + active: plasmoid.configuration.backgroundOnlyOnMaximized || root.disablePanelShadowMaximized 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 2a4aea748..b105d274b 100644 --- a/shell/package/contents/configuration/TweaksConfig.qml +++ b/shell/package/contents/configuration/TweaksConfig.qml @@ -80,7 +80,22 @@ PlasmaComponents.Page { tooltip: i18n("The panel background becomes transparent and is shown only\nwhen there is a maximized window") onClicked: { - plasmoid.configuration.backgroundOnlyOnMaximized = checked + plasmoid.configuration.backgroundOnlyOnMaximized = checked; + plasmoid.configuration.disablePanelShadowForMaximized = false; + hideShadowsOnMaximizedChk.checked = false; + } + } + + PlasmaComponents.CheckBox { + id: hideShadowsOnMaximizedChk + Layout.leftMargin: units.smallSpacing * 2 + text: i18n("Hide panel shadow for maximized windows") + checked: plasmoid.configuration.disablePanelShadowForMaximized + + onClicked: { + plasmoid.configuration.disablePanelShadowForMaximized = checked; + plasmoid.configuration.backgroundOnlyOnMaximized = false; + onlyOnMaximizedChk.checked = false; } } }