Bring back the panel. It's not perfect, but it gives basic functionality.

You may need to delete ~/.kde4/share/config/plasma-appletrc to get the panel

Reloading from the config file is a bit dodgy - waiting on a commit from aseigo
which changes background painting of applets depending on their form factor.

CCMAIL: aseigo@kde.org


svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=719254
This commit is contained in:
Alex Merry 2007-09-30 18:06:08 +00:00
parent 9e54e09dc8
commit 42e49a2b06
3 changed files with 34 additions and 1 deletions

View File

@ -495,6 +495,9 @@ Applet* Containment::addApplet(const QString& name, const QVariantList& args, ui
applet->updateConstraints();
kDebug() << applet->name() << "sizehint:" << applet->sizeHint()
<< "geometry:" << applet->geometry();
if (!delayInit) {
applet->init();
}

View File

@ -153,10 +153,12 @@ void Corona::loadApplets(const QString& config)
if (c) {
containments.insert(c->id(), c);
c->initConstraints(&appletConfig);
c->setGeometry(appletConfig.readEntry("geometry", QRectF()));
kDebug() << "Containment" << c->id() << "geometry is" << c->geometry();
}
} else {
// it's an applet, let's grab the containment association
kDebug() << "insert multi " << group;
kDebug() << "insert multi" << group;
applets.append(appletConfig);
}
}
@ -218,6 +220,22 @@ void Corona::loadDefaultSetup()
c->setScreen(i);
c->setFormFactor(Plasma::Planar);
}
// make a panel at the bottom
Containment* panel = addContainment("panel", (QVariantList() << (int)Plasma::BottomEdge));
// some default applets to get a usable UI
QList<Plasma::Applet*> applets;
Plasma::Applet *tasksApplet = panel->addApplet("tasks");
Plasma::Applet *systemTrayApplet = panel->addApplet("systemtray");
Plasma::Applet *clockApplet = panel->addApplet("digital-clock");
applets << tasksApplet << systemTrayApplet << clockApplet;
foreach (Plasma::Applet* applet , applets) {
// If we have a Panel class (is a Container), this should move there
applet->setDrawStandardBackground(false);
}
}
Containment* Corona::containmentForScreen(int screen) const
@ -231,6 +249,11 @@ Containment* Corona::containmentForScreen(int screen) const
return 0;
}
QList<Containment*> Corona::containments() const
{
return d->containments;
}
void Corona::clearApplets()
{
foreach (Containment* containment, d->containments) {
@ -243,6 +266,8 @@ Containment* Corona::addContainment(const QString& name, const QVariantList& arg
Containment* containment = 0;
Applet* applet = 0;
kDebug() << "Loading" << name << args << id;
if (!name.isEmpty()) {
applet = Applet::loadApplet(name, id, args);
containment = dynamic_cast<Containment*>(applet);

View File

@ -140,6 +140,11 @@ public Q_SLOTS:
*/
Containment* containmentForScreen(int screen) const;
/**
* Returns all containments on this Corona
*/
QList<Containment*> containments() const;
/**
* Adds a SuperKaramba theme to the scene
*