add the ability to get at the max size hint constraint

svn path=/trunk/KDE/kdebase/workspace/plasma/lib/; revision=670578
This commit is contained in:
Aaron J. Seigo 2007-06-02 04:47:09 +00:00
parent 5cd8761ab2
commit df56575ef4
4 changed files with 20 additions and 0 deletions

View File

@ -118,6 +118,13 @@ class PLASMA_EXPORT Applet : public QObject, public QGraphicsItemGroup
*/ */
Location location() const; Location location() const;
/**
* Returns a maximum size hint based on the Corona's space availability
* An applet may choose to violate this size hint, but should try and
* respect it as much as possible.
*/
QRectF maxSizeHint() const;
/** /**
* Returns a list of all known applets in a hash keyed by a unique * Returns a list of all known applets in a hash keyed by a unique
* identifier for each applet * identifier for each applet

View File

@ -166,6 +166,12 @@ void Corona::setFormFactor(FormFactor formFactor)
} }
} }
QRectF Corona::maxSizeHint() const
{
//FIXME: this is a bit of a naive implementation, do you think? =)
// we should factor in how much space we actually have left!
return sceneRect();
}
void Corona::addPlasmoid(const QString& name) void Corona::addPlasmoid(const QString& name)
{ {

View File

@ -56,6 +56,12 @@ public:
**/ **/
Plasma::FormFactor formFactor() const; Plasma::FormFactor formFactor() const;
/**
* A rect containing the maximum size a plasmoid on this corona should
* consider being.
**/
QRectF maxSizeHint() const;
public Q_SLOTS: public Q_SLOTS:
/** /**
* Informs the Corona as to what position it is in. This is informational * Informs the Corona as to what position it is in. This is informational

View File

@ -68,6 +68,7 @@ enum Location { Floating = 0 /**< Free floating. Neither geometry or z-ordering
is described precisely by this value. */, is described precisely by this value. */,
Desktop /**< On the planar desktop layer, extending across Desktop /**< On the planar desktop layer, extending across
the full screen from edge to edge */, the full screen from edge to edge */,
FullScreen /**< Full screen */,
TopEdge /**< Along the top of the screen*/, TopEdge /**< Along the top of the screen*/,
BottomEdge /**< Along the bottom of the screen*/, BottomEdge /**< Along the bottom of the screen*/,
LeftEdge /**< Along the left side of the screen */, LeftEdge /**< Along the left side of the screen */,