* for now MediaCenter gets a FreeLayout

* emit geometryChanged when our location changes in a way that won't trigger an actual geometry adjustment

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=782390
This commit is contained in:
Aaron J. Seigo 2008-03-05 00:06:22 +00:00
parent 9089d89b12
commit a68747bd1d

View File

@ -383,6 +383,7 @@ void Containment::setFormFactor(FormFactor formFactor)
switch (d->formFactor) { switch (d->formFactor) {
case Planar: case Planar:
case MediaCenter:
lay = new FreeLayout(this); lay = new FreeLayout(this);
break; break;
case Horizontal: case Horizontal:
@ -395,10 +396,6 @@ void Containment::setFormFactor(FormFactor formFactor)
lay->setMargins(0, 0, 0, 0); lay->setMargins(0, 0, 0, 0);
lay->setSpacing(4); lay->setSpacing(4);
break; break;
case MediaCenter:
//FIXME: need a layout type here!
setLayout(0); //auto-delete
break;
default: default:
kDebug() << "This can't be happening! Or... can it? ;)" << d->formFactor; kDebug() << "This can't be happening! Or... can it? ;)" << d->formFactor;
setLayout(0); //auto-delete setLayout(0); //auto-delete
@ -430,13 +427,30 @@ void Containment::setLocation(Location location)
return; return;
} }
bool emitGeomChange = false;
if ((location == TopEdge || location == BottomEdge) &&
(d->location == TopEdge || d->location == BottomEdge)) {
emitGeomChange = true;
}
if ((location == RightEdge || location == LeftEdge) &&
(d->location == RightEdge || d->location == LeftEdge)) {
emitGeomChange = true;
}
d->location = location; d->location = location;
foreach (Applet* applet, d->applets) { foreach (Applet* applet, d->applets) {
applet->updateConstraints(Plasma::LocationConstraint); applet->updateConstraints(Plasma::LocationConstraint);
} }
setScreen(screen()); if (emitGeomChange) {
// our geometry on the scene will not actually change,
// but for the purposes of views it has
emit geometryChanged();
}
updateConstraints(Plasma::LocationConstraint); updateConstraints(Plasma::LocationConstraint);
} }
@ -784,11 +798,6 @@ void Containment::setScreen(int screen)
d->screen = screen; d->screen = screen;
updateConstraints(Plasma::ScreenConstraint); updateConstraints(Plasma::ScreenConstraint);
if (containmentType() == PanelContainment) {
// our geometry on the scene may not actually change, but for the purposes of views it has
emit geometryChanged();
}
} }
int Containment::screen() const int Containment::screen() const