* add a Phase object to the corona; start using it.
TODO: * use all the Phase transitions properly; this implies reworking the remove applet mechanism completely * consider sharing Phase amongst all Coronas? should it be a singleton? svn path=/trunk/KDE/kdebase/workspace/lib/plasma/; revision=673395
This commit is contained in:
parent
eb330b2a79
commit
3b8fc737e4
12
corona.cpp
12
corona.cpp
@ -35,11 +35,10 @@
|
|||||||
|
|
||||||
#include "applet.h"
|
#include "applet.h"
|
||||||
#include "dataengine.h"
|
#include "dataengine.h"
|
||||||
|
#include "karambamanager.h"
|
||||||
|
#include "phase.h"
|
||||||
#include "widgets/vboxlayout.h"
|
#include "widgets/vboxlayout.h"
|
||||||
#include "widgets/icon.h"
|
#include "widgets/icon.h"
|
||||||
#include "karambamanager.h"
|
|
||||||
|
|
||||||
#include "corona.h"
|
|
||||||
|
|
||||||
using namespace Plasma;
|
using namespace Plasma;
|
||||||
|
|
||||||
@ -53,12 +52,14 @@ public:
|
|||||||
: formFactor(Planar),
|
: formFactor(Planar),
|
||||||
location(Floating),
|
location(Floating),
|
||||||
layout(0),
|
layout(0),
|
||||||
engineExplorerAction(0)
|
engineExplorerAction(0),
|
||||||
|
phase(new Phase)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
~Private()
|
~Private()
|
||||||
{
|
{
|
||||||
|
delete phase;
|
||||||
delete layout;
|
delete layout;
|
||||||
qDeleteAll(applets);
|
qDeleteAll(applets);
|
||||||
}
|
}
|
||||||
@ -69,6 +70,7 @@ public:
|
|||||||
Location location;
|
Location location;
|
||||||
Layout* layout;
|
Layout* layout;
|
||||||
QAction *engineExplorerAction;
|
QAction *engineExplorerAction;
|
||||||
|
Phase* phase;
|
||||||
};
|
};
|
||||||
|
|
||||||
Corona::Corona(QObject * parent)
|
Corona::Corona(QObject * parent)
|
||||||
@ -193,6 +195,7 @@ void Corona::addPlasmoid(const QString& name)
|
|||||||
d->applets << applet;
|
d->applets << applet;
|
||||||
connect(applet, SIGNAL(destroyed(QObject*)),
|
connect(applet, SIGNAL(destroyed(QObject*)),
|
||||||
this, SLOT(appletDestroyed(QObject*)));
|
this, SLOT(appletDestroyed(QObject*)));
|
||||||
|
d->phase->animate(applet, Phase::Appear);
|
||||||
} else {
|
} else {
|
||||||
kDebug() << "Plasmoid " << name << " could not be loaded." << endl;
|
kDebug() << "Plasmoid " << name << " could not be loaded." << endl;
|
||||||
}
|
}
|
||||||
@ -203,6 +206,7 @@ void Corona::addKaramba(const KUrl& path)
|
|||||||
QGraphicsItemGroup* karamba = KarambaManager::loadKaramba(path, this);
|
QGraphicsItemGroup* karamba = KarambaManager::loadKaramba(path, this);
|
||||||
if (karamba) {
|
if (karamba) {
|
||||||
addItem(karamba);
|
addItem(karamba);
|
||||||
|
d->phase->animate(karamba, Phase::Appear);
|
||||||
} else {
|
} else {
|
||||||
kDebug() << "Karamba " << path << " could not be loaded." << endl;
|
kDebug() << "Karamba " << path << " could not be loaded." << endl;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user