From 49d8b145d26bc7c0f8e94e42e4b1127abc456f72 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 18 May 2017 01:23:15 +0300 Subject: [PATCH] fixes for showBackOnlyOnMaximized design --improve applets shadows, now the shadows used are using the backgroundColor when a transparent panel is forced --identify better when shadows should be drawn --- app/dockview.cpp | 8 ++++---- containment/package/contents/ui/AppletItem.qml | 4 ++-- containment/package/contents/ui/main.qml | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/dockview.cpp b/app/dockview.cpp index 605666818..4b3878cb7 100644 --- a/app/dockview.cpp +++ b/app/dockview.cpp @@ -792,8 +792,8 @@ void DockView::setBehaveAsPlasmaPanel(bool behavior) PanelShadows::self()->addWindow(this, enabledBorders()); } else { PanelShadows::self()->removeWindow(this); - m_enabledBorders = Plasma::FrameSvg::AllBorders; - emit enabledBordersChanged(); + // m_enabledBorders = Plasma::FrameSvg::AllBorders; + // emit enabledBordersChanged(); } updateEffects(); @@ -817,8 +817,8 @@ void DockView::setDrawShadows(bool draw) PanelShadows::self()->addWindow(this, enabledBorders()); } else { PanelShadows::self()->removeWindow(this); - m_enabledBorders = Plasma::FrameSvg::AllBorders; - emit enabledBordersChanged(); + //m_enabledBorders = Plasma::FrameSvg::AllBorders; + //emit enabledBordersChanged(); } emit drawShadowsChanged(); diff --git a/containment/package/contents/ui/AppletItem.qml b/containment/package/contents/ui/AppletItem.qml index 5d6951d2b..738122b38 100644 --- a/containment/package/contents/ui/AppletItem.qml +++ b/containment/package/contents/ui/AppletItem.qml @@ -835,13 +835,13 @@ Item { sourceComponent: DropShadow{ anchors.fill: parent - color: forcedShadow ? "#ff040404" : "#ff080808" + color: forcedShadow ? theme.backgroundColor : "#ff080808" samples: 2 * radius source: container.fakeIconItem ? wrapperContainer : container.applet radius: shadowSize verticalOffset: forcedShadow ? 1 : 2 - property int shadowSize : forcedShadow? 7 : Math.ceil(root.iconSize / 12) + property int shadowSize : forcedShadow? 8 : Math.ceil(root.iconSize / 12) property bool forcedShadow: root.forceTransparentPanel && applet.pluginName !== root.plasmoidName ? true : false } diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index 62c7a310a..fdb5df2c0 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -120,7 +120,8 @@ DragDrop.DropArea { property int panelEdgeSpacing: iconSize / 3 property int panelTransparency: plasmoid.configuration.panelTransparency - property bool panelShadowsActive: plasmoid.configuration.panelShadows && !root.forceTransparentPanel + property bool panelShadowsActive: (plasmoid.configuration.panelShadows && !root.backgroundOnlyOnMaximized) + || (plasmoid.configuration.panelShadows && root.backgroundOnlyOnMaximized && windowsModel.hasMaximizedWindow) property int totalPanelEdgeSpacing: 0 //this is set by PanelBox //FIXME: this is not needed any more probably