diff --git a/src/plasma/private/theme_p.h b/src/plasma/private/theme_p.h --- a/src/plasma/private/theme_p.h +++ b/src/plasma/private/theme_p.h @@ -76,6 +76,7 @@ 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 @@ 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/private/theme_p.cpp b/src/plasma/private/theme_p.cpp --- a/src/plasma/private/theme_p.cpp +++ b/src/plasma/private/theme_p.cpp @@ -75,6 +75,7 @@ backgroundIntensity(qQNaN()), backgroundSaturation(qQNaN()), backgroundContrastEnabled(true), + blurBehindEnabled(true), apiMajor(1), apiMinor(0), apiRevision(0) @@ -736,6 +737,17 @@ } } +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 @@ pluginInfo = KPluginInfo(metadataPath); processContrastSettings(&metadata); + processBlurBehindSettings(&metadata); processWallpaperSettings(&metadata); diff --git a/src/plasma/theme.h b/src/plasma/theme.h --- a/src/plasma/theme.h +++ b/src/plasma/theme.h @@ -380,6 +380,22 @@ */ 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/plasma/theme.cpp b/src/plasma/theme.cpp --- a/src/plasma/theme.cpp +++ b/src/plasma/theme.cpp @@ -510,6 +510,11 @@ return d->backgroundSaturation; } +bool Theme::blurBehindEnabled() const +{ + return d->blurBehindEnabled; +} + } #include "moc_theme.cpp" diff --git a/src/plasmaquick/dialog.cpp b/src/plasmaquick/dialog.cpp --- a/src/plasmaquick/dialog.cpp +++ b/src/plasmaquick/dialog.cpp @@ -241,7 +241,7 @@ 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(),