propagate drawWallpaperChanged

This commit is contained in:
Marco Martin 2013-09-10 12:38:41 +02:00
parent e5b2907b53
commit 6bbc8cb420
6 changed files with 26 additions and 3 deletions

View File

@ -453,7 +453,12 @@ int Containment::screen() const
void Containment::setDrawWallpaper(bool drawWallpaper)
{
if (d->drawWallpaper == drawWallpaper) {
return;
}
d->drawWallpaper = drawWallpaper;
emit drawWallpaperChanged();
}
bool Containment::drawWallpaper()

View File

@ -273,6 +273,11 @@ Q_SIGNALS:
*/
void uiReadyChanged(bool uiReady);
/**
* Emitted when the value of drawWallpaper() has changed
*/
void drawWallpaperChanged();
public Q_SLOTS:
/**
* Informs the Corona as to what position it is in. This is informational

View File

@ -39,6 +39,10 @@ AppletScript::AppletScript(QObject *parent)
d(new AppletScriptPrivate)
{
d->applet = 0;
Plasma::Containment *cont = qobject_cast<Plasma::Containment *>(d->applet);
if (cont) {
connect(cont, &Plasma::Containment::drawWallpaperChanged, this, &AppletScript::drawWallpaperChanged);
}
}
AppletScript::~AppletScript()

View File

@ -150,6 +150,11 @@ Q_SIGNALS:
*/
void uiReadyChanged(bool uiReady);
/**
* Emitted when the value of drawWallpaper() has changed
*/
void drawWallpaperChanged();
public Q_SLOTS:
/**

View File

@ -67,6 +67,8 @@ ContainmentInterface::ContainmentInterface(DeclarativeAppletScript *parent)
this, &ContainmentInterface::activityChanged);
connect(containment(), &Plasma::Containment::wallpaperChanged,
this, &ContainmentInterface::loadWallpaper);
connect(containment(), &Plasma::Containment::drawWallpaperChanged,
this, &ContainmentInterface::drawWallpaperChanged);
if (containment()->corona()) {
connect(containment()->corona(), &Plasma::Corona::availableScreenRegionChanged,

View File

@ -44,14 +44,14 @@ class ContainmentInterface : public AppletInterface
Q_PROPERTY(QList <QObject *> applets READ applets NOTIFY appletsChanged)
/**
* True if the containment should draw a wallpaper TODO: notify
* True if the containment should draw a wallpaper
*/
Q_PROPERTY(bool drawWallpaper READ drawWallpaper WRITE setDrawWallpaper)
Q_PROPERTY(bool drawWallpaper READ drawWallpaper WRITE setDrawWallpaper NOTIFY drawWallpaperChanged)
/**
* Type of this containment TODO: notify
*/
Q_PROPERTY(Plasma::Types::ContainmentType containmentType READ containmentType WRITE setContainmentType)
Q_PROPERTY(Plasma::Types::ContainmentType containmentType READ containmentType WRITE setContainmentType NOTIFY containmentTypeChanged)
/**
* Activity name of this containment
@ -124,6 +124,8 @@ Q_SIGNALS:
void activityChanged();
void availableScreenRegionChanged();
void appletsChanged();
void drawWallpaperChanged();
void containmentTypeChanged();
///void immutableChanged();
protected Q_SLOTS: