pi changes:

raise() is now a slot, a new lower() slot was added

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=800280
This commit is contained in:
Marco Martin 2008-04-23 20:27:44 +00:00
parent afc9290365
commit 710be86ffd
2 changed files with 19 additions and 9 deletions

View File

@ -315,6 +315,7 @@ public:
// number of members at this point.
static uint s_maxAppletId;
static uint s_maxZValue;
static uint s_minZValue;
static PackageStructure::Ptr packageStructure;
uint appletId;
KPluginInfo appletDescription;
@ -343,6 +344,7 @@ public:
uint Applet::Private::s_maxAppletId = 0;
uint Applet::Private::s_maxZValue = 0;
uint Applet::Private::s_minZValue = 0;
PackageStructure::Ptr Applet::Private::packageStructure(0);
Applet::Applet(QGraphicsItem *parent,
@ -437,11 +439,9 @@ void Applet::restore(KConfigGroup *c)
setTransform(t);
}
qreal z = c->readEntry("zvalue", -1);
qreal z = c->readEntry("zvalue", 0);
if (z < 0) {
z = ++Private::s_maxZValue;
} else if (z >= Private::s_maxZValue) {
if (z >= Private::s_maxZValue) {
Private::s_maxZValue = z;
}
@ -1549,6 +1549,11 @@ void Applet::raise()
setZValue(++Private::s_maxZValue);
}
void Applet::lower()
{
setZValue(--Private::s_minZValue);
}
void Applet::setIsContainment(bool isContainment)
{
d->isContainment = isContainment;

View File

@ -506,11 +506,6 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
*/
void setGeometry(const QRectF &geometry);
/**
* Causes this applet to raise above all other applets.
*/
void raise();
/**
* Reimplemented from QGraphicsItem
**/
@ -597,6 +592,16 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
*/
virtual void createConfigurationInterface(KConfigDialog *parent);
/**
* Causes this applet to raise above all other applets.
*/
void raise();
/**
* Causes this applet to lower below all the other applets.
*/
void lower();
/**
* Sends all pending contraints updates to the applet. Will usually
* be called automatically, but can also be called manually if needed.