From 899c0155c7ebc2114e2a855055ef3fa92dbb09f7 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 27 Jun 2022 12:41:22 +0300 Subject: [PATCH] plasmatheme:define max background opacity to 1% BUG:443366 --- app/plasma/extended/panelbackground.cpp | 6 ++++++ containment/package/contents/ui/background/MultiLayered.qml | 3 +++ 2 files changed, 9 insertions(+) diff --git a/app/plasma/extended/panelbackground.cpp b/app/plasma/extended/panelbackground.cpp index d59babd63..f5fd98440 100644 --- a/app/plasma/extended/panelbackground.cpp +++ b/app/plasma/extended/panelbackground.cpp @@ -140,6 +140,12 @@ void PanelBackground::updateMaxOpacity(Plasma::Svg *svg) m_maxOpacity = alphasum / (float)(2 * CENTERWIDTH); + //! minimum acceptable panel background opacity is 1%. Such is a case is when + //! panel background is fully transparent but it provides a border. In such case + //! previous approach was identifying as background max opacity 0% and in such case + //! all the upcoming calculations where returning a fully transparent plasma svg to the user + m_maxOpacity = qMax(0.01f, m_maxOpacity); + emit maxOpacityChanged(); } diff --git a/containment/package/contents/ui/background/MultiLayered.qml b/containment/package/contents/ui/background/MultiLayered.qml index 6efed163c..1b6b1d9de 100644 --- a/containment/package/contents/ui/background/MultiLayered.qml +++ b/containment/package/contents/ui/background/MultiLayered.qml @@ -245,6 +245,9 @@ BackgroundProperties{ property int animationTime: 6*animations.speedFactor.current*animations.duration.small + //! Opacity related + readonly property bool isDefaultOpacityEnabled: plasmoid.configuration.panelTransparency===-1 + //! Metrics related readonly property bool isGreaterThanItemThickness: root.useThemePanel && (totals.visualThickness >= (metrics.iconSize + metrics.margin.tailThickness))