diff --git a/shell/scripting/widget.h b/shell/scripting/widget.h --- a/shell/scripting/widget.h +++ b/shell/scripting/widget.h @@ -49,6 +49,7 @@ Q_PROPERTY(QStringList currentConfigGroup WRITE setCurrentConfigGroup READ currentConfigGroup) Q_PROPERTY(QString globalShortcut WRITE setGlobalShortcut READ globalShorcut) Q_PROPERTY(bool locked READ locked WRITE setLocked) + Q_PROPERTY(QString userBackgroundHints WRITE setUserBackgroundHints READ userBackgroundHints) public: explicit Widget(Plasma::Applet *applet, QObject *parent = nullptr); @@ -66,6 +67,9 @@ void setGlobalShortcut(const QString &shortcut); QString globalShorcut() const; + QString userBackgroundHints() const; + void setUserBackgroundHints(QString hint); + Plasma::Applet *applet() const override; public Q_SLOTS: diff --git a/shell/scripting/widget.cpp b/shell/scripting/widget.cpp --- a/shell/scripting/widget.cpp +++ b/shell/scripting/widget.cpp @@ -20,6 +20,7 @@ #include "widget.h" #include +#include #include #include @@ -176,6 +177,22 @@ }*/ } +QString Widget::userBackgroundHints() const +{qWarning()<<"DJENT"; + QMetaEnum hintEnum = QMetaEnum::fromType(); + return hintEnum.valueToKey(applet()->userBackgroundHints()); +} + +void Widget::setUserBackgroundHints(QString hint) +{ + QMetaEnum hintEnum = QMetaEnum::fromType(); + bool ok; + int value = hintEnum.keyToValue(hint.toUtf8().constData(), &ok); + if (ok) { + applet()->setUserBackgroundHints(Plasma::Types::BackgroundHints(value)); + } +} + }