dont draw panel shadows when theme doesnot provide

when the plasma theme was not supporting shadows then
Latte was double drawing the panel background when
the user has chosen that wanted shadows

BUG: 397980
FIXED-IN: 0.8.1
pull/2/head
Michail Vourlakos 7 years ago
parent 6070d2b0f0
commit 87094a6fe7

@ -221,6 +221,7 @@ void DockView::init()
connect(this, &DockView::effectsAreaChanged, this, &DockView::updateEffects);
connect(&m_theme, &Plasma::Theme::themeChanged, this, &DockView::themeChanged);
connect(&m_theme, &Plasma::Theme::themeChanged, this, &DockView::themeHasShadowChanged);
connect(this, &DockView::normalThicknessChanged, this, [&]() {
if (m_behaveAsPlasmaPanel) {
@ -1288,6 +1289,10 @@ void DockView::setMaskArea(QRect area)
emit maskAreaChanged();
}
bool DockView::themeHasShadow() const
{
return PanelShadows::self()->enabled();
}
QRect DockView::effectsArea() const
{

@ -71,6 +71,7 @@ class DockView : public PlasmaQuick::ContainmentView
//! Because Latte uses animations, changing to edit mode it may be different than
//! when the isUserConfiguring changes value
Q_PROPERTY(bool inEditMode READ inEditMode WRITE setInEditMode NOTIFY inEditModeChanged)
Q_PROPERTY(bool themeHasShadow READ themeHasShadow NOTIFY themeHasShadowChanged)
Q_PROPERTY(bool onPrimary READ onPrimary WRITE setOnPrimary NOTIFY onPrimaryChanged)
Q_PROPERTY(int alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged)
@ -148,6 +149,8 @@ public:
bool inEditMode() const;
void setInEditMode(bool edit);
bool themeHasShadow() const;
float maxLength() const;
void setMaxLength(float length);
@ -293,6 +296,7 @@ signals:
void screenGeometryChanged();
void shadowChanged();
void themeChanged();
void themeHasShadowChanged();
void totalDocksCountChanged();
void xChanged();
void yChanged();

@ -138,9 +138,9 @@ Item{
panelSize + marginsHeight - (solidBackground.topIncreaser + solidBackground.bottomIncreaser)
imagePath: root.behaveAsPlasmaPanel || !Latte.WindowSystem.compositingActive
|| !root.panelShadowsActive ? "" : "widgets/panel-background"
|| !root.panelShadowsActive || !themeHasShadow ? "" : "widgets/panel-background"
prefix: root.behaveAsPlasmaPanel || !Latte.WindowSystem.compositingActive
|| !root.panelShadowsActive ? "" : "shadow"
|| !root.panelShadowsActive || !themeHasShadow ? "" : "shadow"
visible: (opacity == 0) ? false : true
@ -153,6 +153,8 @@ Item{
enabledBorders: dock ? dock.enabledBorders : PlasmaCore.FrameSvg.NoBorder
property bool themeHasShadow: dock ? dock.themeHasShadow : false
Behavior on opacity {
enabled: Latte.WindowSystem.compositingActive
NumberAnimation { duration: barLine.animationTime }

Loading…
Cancel
Save