diff --git a/app/dockview.cpp b/app/dockview.cpp index c8a1d979f..21e4f4b7e 100644 --- a/app/dockview.cpp +++ b/app/dockview.cpp @@ -198,6 +198,7 @@ void DockView::init() updateFormFactor(); syncGeometry(); }); + connect(this, &DockView::dockTransparencyChanged, this, &DockView::updateEffects); connect(this, &DockView::drawEffectsChanged, this, &DockView::updateEffects); connect(this, &DockView::effectsAreaChanged, this, &DockView::updateEffects); @@ -1087,6 +1088,21 @@ void DockView::setOffset(int offset) emit offsetChanged(); } +int DockView::dockTransparency() const +{ + return m_dockTransparency; +} + +void DockView::setDockTransparency(int transparency) +{ + if (m_dockTransparency == transparency) { + return; + } + + m_dockTransparency = transparency; + emit dockTransparencyChanged(); +} + int DockView::shadow() const { return m_shadow; @@ -1133,10 +1149,11 @@ void DockView::updateEffects() KWindowEffects::enableBlurBehind(winId(), true, fixedMask); + bool drawBackgroundEffect = m_theme.backgroundContrastEnabled() && (m_dockTransparency == 100); //based on Breeze Dark theme behavior the enableBackgroundContrast even though it does accept //a QRegion it uses only the first rect. The bug was that for Breeze Dark there was a line //at the dock bottom that was distinguishing it from other themes - KWindowEffects::enableBackgroundContrast(winId(), m_theme.backgroundContrastEnabled(), + KWindowEffects::enableBackgroundContrast(winId(), drawBackgroundEffect, m_theme.backgroundContrast(), m_theme.backgroundIntensity(), m_theme.backgroundSaturation(), diff --git a/app/dockview.h b/app/dockview.h index ad64e1f24..3cb0968bb 100644 --- a/app/dockview.h +++ b/app/dockview.h @@ -60,6 +60,7 @@ class DockView : public PlasmaQuick::ContainmentView { Q_PROPERTY(int alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged) Q_PROPERTY(int docksCount READ docksCount NOTIFY docksCountChanged) + Q_PROPERTY(int dockTransparency READ dockTransparency WRITE setDockTransparency NOTIFY dockTransparencyChanged) Q_PROPERTY(int totalDocksCount READ totalDocksCount NOTIFY totalDocksCountChanged) Q_PROPERTY(int x READ x NOTIFY xChanged) Q_PROPERTY(int y READ y NOTIFY yChanged) @@ -120,6 +121,9 @@ public: float maxLength() const; void setMaxLength(float length); + int dockTransparency() const; + void setDockTransparency(int transparency); + int maxThickness() const; void setMaxThickness(int thickness); @@ -202,6 +206,7 @@ signals: void currentScreenChanged(); void dockLocationChanged(); void docksCountChanged(); + void dockTransparencyChanged(); void dockWinBehaviorChanged(); void drawShadowsChanged(); void drawEffectsChanged(); @@ -254,6 +259,7 @@ private: bool m_drawShadows{true}; bool m_drawEffects{false}; bool m_onPrimary{true}; + int m_dockTransparency{100}; int m_maxThickness{24}; int m_normalThickness{24}; int m_offset{0}; diff --git a/containment/package/contents/ui/VisibilityManager.qml b/containment/package/contents/ui/VisibilityManager.qml index 1c9763aea..1d8ab45af 100644 --- a/containment/package/contents/ui/VisibilityManager.qml +++ b/containment/package/contents/ui/VisibilityManager.qml @@ -85,6 +85,13 @@ Item{ value: root.behaveAsPlasmaPanel } + Binding{ + target: dock + property: "dockTransparency" + when: dock + value: root.panelTransparency + } + Binding{ target: dock property: "drawShadows"