diff --git a/src/declarativeimports/core/framesvgitem.cpp b/src/declarativeimports/core/framesvgitem.cpp index 1a80adbcb..8f4404a1e 100644 --- a/src/declarativeimports/core/framesvgitem.cpp +++ b/src/declarativeimports/core/framesvgitem.cpp @@ -272,6 +272,7 @@ FrameSvgItem::FrameSvgItem(QQuickItem *parent) connect(&Units::instance(), &Units::devicePixelRatioChanged, this, &FrameSvgItem::updateDevicePixelRatio); connect(m_frameSvg, &Svg::fromCurrentThemeChanged, this, &FrameSvgItem::fromCurrentThemeChanged); connect(m_frameSvg, &Svg::statusChanged, this, &FrameSvgItem::statusChanged); + connect(m_frameSvg, &Svg::sizeChanged, this, &FrameSvgItem::maskChanged); } FrameSvgItem::~FrameSvgItem() @@ -455,6 +456,12 @@ bool FrameSvgItem::hasElementPrefix(const QString &prefix) const return m_frameSvg->hasElementPrefix(prefix); } + +QRegion FrameSvgItem::mask() const +{ + return m_frameSvg->mask(); +} + void FrameSvgItem::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) { diff --git a/src/declarativeimports/core/framesvgitem.h b/src/declarativeimports/core/framesvgitem.h index b92cba35c..017fdf013 100644 --- a/src/declarativeimports/core/framesvgitem.h +++ b/src/declarativeimports/core/framesvgitem.h @@ -183,6 +183,12 @@ class FrameSvgItem : public QQuickItem */ Q_PROPERTY(Plasma::Svg::Status status READ status WRITE setStatus NOTIFY statusChanged) + /** + * The mask that tightly contains the painted areas + * @since 5.58 + */ + Q_PROPERTY(QRegion mask READ mask NOTIFY maskChanged) + public: /** * @return true if the svg has the necessary elements with the given prefix @@ -220,6 +226,8 @@ public: void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; + QRegion mask() const; + /** * Only to be used from inside this library, is not intended to be invokable */ @@ -244,6 +252,7 @@ Q_SIGNALS: void repaintNeeded(); void statusChanged(); void usedPrefixChanged(); + void maskChanged(); private Q_SLOTS: void doUpdate(); diff --git a/src/plasmaquick/dialog.cpp b/src/plasmaquick/dialog.cpp index 4c7e97189..ecdf968ca 100644 --- a/src/plasmaquick/dialog.cpp +++ b/src/plasmaquick/dialog.cpp @@ -241,13 +241,13 @@ void DialogPrivate::updateTheme() frameSvgItem->setImagePath(QStringLiteral("dialogs/background")); } - KWindowEffects::enableBlurBehind(q->winId(), theme.blurBehindEnabled(), frameSvgItem->frameSvg()->mask()); + KWindowEffects::enableBlurBehind(q->winId(), theme.blurBehindEnabled(), frameSvgItem->mask()); KWindowEffects::enableBackgroundContrast(q->winId(), theme.backgroundContrastEnabled(), theme.backgroundContrast(), theme.backgroundIntensity(), theme.backgroundSaturation(), - frameSvgItem->frameSvg()->mask()); + frameSvgItem->mask()); if (KWindowSystem::compositingActive()) { if (hasMask) { @@ -256,7 +256,7 @@ void DialogPrivate::updateTheme() } } else { hasMask = true; - q->setMask(frameSvgItem->frameSvg()->mask()); + q->setMask(frameSvgItem->mask()); } if (q->isVisible()) { DialogShadows::self()->addWindow(q, frameSvgItem->enabledBorders());