Addition of applets to a panel require different geometry handling than

to a desktop. This patch just splits the handling into two branches so as
to make the upcoming changes easier to read.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=752327
This commit is contained in:
Jason Stubbs 2007-12-24 07:49:33 +00:00
parent 45c7a63a1f
commit efcc2c6128

View File

@ -399,11 +399,15 @@ Applet* Containment::addApplet(const QString& name, const QVariantList& args, ui
applet = new Applet;
}
switch (containmentType()) {
case PanelContainment:
//panels don't want backgrounds, which is important when setting geometry
if (containmentType() == PanelContainment) {
applet->setDrawStandardBackground(false);
}
addApplet(applet);
break;
default:
addApplet(applet);
//the applet needs to be given constraints before it can set its geometry
@ -419,6 +423,7 @@ Applet* Containment::addApplet(const QString& name, const QVariantList& args, ui
} else if (geometry().isValid()) {
applet->setGeometry(geometryForApplet(applet));
}
}
//kDebug() << applet->name() << "sizehint:" << applet->sizeHint() << "geometry:" << applet->geometry();