From 42e49a2b06a564ba5693e42334899f7481dde530 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Sun, 30 Sep 2007 18:06:08 +0000 Subject: [PATCH] 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 --- containment.cpp | 3 +++ corona.cpp | 27 ++++++++++++++++++++++++++- corona.h | 5 +++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/containment.cpp b/containment.cpp index 8f2131f47..7f1ba52f8 100644 --- a/containment.cpp +++ b/containment.cpp @@ -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(); } diff --git a/corona.cpp b/corona.cpp index 224afacd8..9e7137545 100644 --- a/corona.cpp +++ b/corona.cpp @@ -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 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 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(applet); diff --git a/corona.h b/corona.h index a8e931e27..e06626685 100644 --- a/corona.h +++ b/corona.h @@ -140,6 +140,11 @@ public Q_SLOTS: */ Containment* containmentForScreen(int screen) const; + /** + * Returns all containments on this Corona + */ + QList containments() const; + /** * Adds a SuperKaramba theme to the scene *