* remove the lock/move stuff as it ignores kiosk and is already covered nicely by isImmutable and setImmutable

* on the base implementation of contentSize, check to see if we have a layout and if so use that to determine the size we ought to be

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=693769
This commit is contained in:
Aaron J. Seigo 2007-07-28 23:41:40 +00:00
parent 08fca6641e
commit 947ed386ab
2 changed files with 6 additions and 43 deletions

View File

@ -579,8 +579,11 @@ Location Applet::location() const
QSizeF Applet::contentSize() const QSizeF Applet::contentSize() const
{ {
//FIXME: this should be big enough to allow for the failure text? if (layout()) {
return QSizeF(300, 300); return layout()->sizeHint();
}
return QSizeF(0, 0);
} }
QString Applet::globalName() const QString Applet::globalName() const
@ -754,34 +757,6 @@ Applet* Applet::loadApplet(const KPluginInfo& info, uint appletId, const QString
return loadApplet(info.pluginName(), appletId, args); return loadApplet(info.pluginName(), appletId, args);
} }
void Applet::slotLockApplet(bool lock)
{
if(lock)
setFlags( flags()^QGraphicsItem::ItemIsMovable);
else
setFlags( flags() | QGraphicsItem::ItemIsMovable);
}
bool Applet::lockApplet() const
{
return !(flags() & QGraphicsItem::ItemIsMovable);
}
void Applet::setLockApplet(bool lock)
{
slotLockApplet(lock);
}
bool Applet::canBeMoved() const
{
return d->canMove;
}
void Applet::setCanBeMoved( bool move)
{
d->canMove = move;
}
} // Plasma namespace } // Plasma namespace
#include "applet.moc" #include "applet.moc"

View File

@ -61,7 +61,6 @@ class PLASMA_EXPORT Applet : public QObject, public Widget
Q_PROPERTY( bool immutable READ isImmutable WRITE setImmutable ) Q_PROPERTY( bool immutable READ isImmutable WRITE setImmutable )
Q_PROPERTY( bool drawStandardBackground READ drawStandardBackground WRITE setDrawStandardBackground ) Q_PROPERTY( bool drawStandardBackground READ drawStandardBackground WRITE setDrawStandardBackground )
Q_PROPERTY( bool failedToLaunch READ failedToLaunch WRITE setFailedToLaunch ) Q_PROPERTY( bool failedToLaunch READ failedToLaunch WRITE setFailedToLaunch )
Q_PROPERTY( bool lockApplet READ lockApplet WRITE setLockApplet )
Q_PROPERTY( QRectF boundingRect READ boundingRect ) Q_PROPERTY( QRectF boundingRect READ boundingRect )
public: public:
@ -317,7 +316,7 @@ class PLASMA_EXPORT Applet : public QObject, public Widget
* .desktop file. * .desktop file.
*/ */
QString category() const; QString category() const;
/** /**
* Returns the color corresponding to the applet's category. * Returns the color corresponding to the applet's category.
*/ */
@ -396,14 +395,6 @@ class PLASMA_EXPORT Applet : public QObject, public Widget
**/ **/
QRectF boundingRect () const; QRectF boundingRect () const;
bool lockApplet() const;
void setLockApplet(bool lock);
bool canBeMoved() const;
void setCanBeMoved( bool move);
Q_SIGNALS: Q_SIGNALS:
/** /**
* Emitted when the applet needs to take (or lose) keyboard focus. * Emitted when the applet needs to take (or lose) keyboard focus.
@ -420,9 +411,6 @@ class PLASMA_EXPORT Applet : public QObject, public Widget
**/ **/
void requestFocus( bool focus ); void requestFocus( bool focus );
protected Q_SLOTS:
void slotLockApplet(bool);
protected: protected:
/** /**
* Returns the name of the applet. * Returns the name of the applet.