diff --git a/src/plasma/private/theme_p.cpp b/src/plasma/private/theme_p.cpp index b6b805048..21a2879de 100644 --- a/src/plasma/private/theme_p.cpp +++ b/src/plasma/private/theme_p.cpp @@ -75,6 +75,7 @@ ThemePrivate::ThemePrivate(QObject *parent) backgroundIntensity(qQNaN()), backgroundSaturation(qQNaN()), backgroundContrastEnabled(true), + blurBehindEnabled(true), apiMajor(1), apiMinor(0), apiRevision(0) @@ -736,6 +737,17 @@ void ThemePrivate::processContrastSettings(KConfigBase *metadata) } } +void ThemePrivate::processBlurBehindSettings(KConfigBase *metadata) +{ + KConfigGroup cg; + if (metadata->hasGroup("BlurBehindEffect")) { + cg = KConfigGroup(metadata, "BlurBehindEffect"); + blurBehindEnabled = cg.readEntry("enabled", true); + } else { + blurBehindEnabled = true; + } +} + void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings, bool emitChanged) { QString theme = tempThemeName; @@ -800,6 +812,7 @@ void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings pluginInfo = KPluginInfo(metadataPath); processContrastSettings(&metadata); + processBlurBehindSettings(&metadata); processWallpaperSettings(&metadata); diff --git a/src/plasma/private/theme_p.h b/src/plasma/private/theme_p.h index 68f3cfd22..cbf203d78 100644 --- a/src/plasma/private/theme_p.h +++ b/src/plasma/private/theme_p.h @@ -76,6 +76,7 @@ public: void setThemeName(const QString &themeName, bool writeSettings, bool emitChanged); void processWallpaperSettings(KConfigBase *metadata); void processContrastSettings(KConfigBase *metadata); + void processBlurBehindSettings(KConfigBase *metadata); const QString processStyleSheet(const QString &css, Plasma::Svg::Status status); const QString svgStyleSheet(Plasma::Theme::ColorGroup group, Plasma::Svg::Status status); @@ -156,6 +157,7 @@ public: qreal backgroundIntensity; qreal backgroundSaturation; bool backgroundContrastEnabled; + bool blurBehindEnabled; //Version number of Plasma the Theme has been designed for int apiMajor; diff --git a/src/plasma/theme.cpp b/src/plasma/theme.cpp index b18e48ce2..aaebaa7db 100644 --- a/src/plasma/theme.cpp +++ b/src/plasma/theme.cpp @@ -510,6 +510,11 @@ qreal Theme::backgroundSaturation() const return d->backgroundSaturation; } +bool Theme::blurBehindEnabled() const +{ + return d->blurBehindEnabled; +} + } #include "moc_theme.cpp" diff --git a/src/plasma/theme.h b/src/plasma/theme.h index 59c65a2ed..441e28fe5 100644 --- a/src/plasma/theme.h +++ b/src/plasma/theme.h @@ -380,6 +380,22 @@ public: */ qreal backgroundSaturation() const; + /** This method allows Plasma to enable and disable the blurring + * of what is behind the background for a given theme. The + * value is read from the "enabled" key in the "BlurBehindEffect" + * group in the Theme's metadata file. Default is @c true. + * + * The configuration in the metadata.desktop file of the theme + * could look like this: + * \code + * [BlurBehindEffect] + * enabled=false + * \endcode + * @return Whether or not to enable blurring of what is behind + * @since 5.57 + */ + bool blurBehindEnabled() const; + /** * Returns the size of the letter "M" as rendered on the screen with the given font. * This values gives you a base size that: diff --git a/src/plasmaquick/dialog.cpp b/src/plasmaquick/dialog.cpp index b9f2ee897..28732dfe2 100644 --- a/src/plasmaquick/dialog.cpp +++ b/src/plasmaquick/dialog.cpp @@ -241,7 +241,7 @@ void DialogPrivate::updateTheme() frameSvgItem->setImagePath(QStringLiteral("dialogs/background")); } - KWindowEffects::enableBlurBehind(q->winId(), true, frameSvgItem->frameSvg()->mask()); + KWindowEffects::enableBlurBehind(q->winId(), theme.blurBehindEnabled(), frameSvgItem->frameSvg()->mask()); KWindowEffects::enableBackgroundContrast(q->winId(), theme.backgroundContrastEnabled(), theme.backgroundContrast(),