put the applet notification of immutability in the containment

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=780750
This commit is contained in:
Aaron J. Seigo 2008-02-29 22:17:55 +00:00
parent 241f31a32a
commit 8c1990f49b
2 changed files with 8 additions and 10 deletions

View File

@ -176,16 +176,18 @@ void Containment::saveConstraints(KConfigGroup* group) const
void Containment::containmentConstraintsUpdated(Plasma::Constraints constraints)
{
//kDebug() << "got containmentConstraintsUpdated" << constraints << (QObject*)d->toolbox;
if (d->toolbox) {
if (constraints & Plasma::ScreenConstraint) {
d->toolbox->setPos(geometry().width() - d->toolbox->boundingRect().width(), 0);
if (constraints & Plasma::ImmutableConstraint) {
// tell the applets too
foreach (Applet *a, d->applets) {
a->constraintsUpdated(ImmutableConstraint);
}
}
if (constraints & Plasma::ImmutableConstraint) {
if (constraints & Plasma::ScreenConstraint && d->toolbox) {
d->toolbox->setPos(geometry().width() - d->toolbox->boundingRect().width(), 0);
d->toolbox->enableTool("addwidgets", !isImmutable());
}
}
}
Containment::Type Containment::containmentType() const
{

View File

@ -97,10 +97,6 @@ public:
foreach (Containment *c, containments) {
// we need to tell each containment that immutability has been altered
c->updateConstraints(ImmutableConstraint);
// tell the applets too
foreach (Applet *a, c->applets()) {
a->constraintsUpdated(ImmutableConstraint);
}
}
}