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:
parent
5cd8761ab2
commit
df56575ef4
7
applet.h
7
applet.h
@ -118,6 +118,13 @@ class PLASMA_EXPORT Applet : public QObject, public QGraphicsItemGroup
|
||||
*/
|
||||
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
|
||||
* identifier for each applet
|
||||
|
@ -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)
|
||||
{
|
||||
|
6
corona.h
6
corona.h
@ -56,6 +56,12 @@ public:
|
||||
**/
|
||||
Plasma::FormFactor formFactor() const;
|
||||
|
||||
/**
|
||||
* A rect containing the maximum size a plasmoid on this corona should
|
||||
* consider being.
|
||||
**/
|
||||
QRectF maxSizeHint() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
/**
|
||||
* Informs the Corona as to what position it is in. This is informational
|
||||
|
1
plasma.h
1
plasma.h
@ -68,6 +68,7 @@ enum Location { Floating = 0 /**< Free floating. Neither geometry or z-ordering
|
||||
is described precisely by this value. */,
|
||||
Desktop /**< On the planar desktop layer, extending across
|
||||
the full screen from edge to edge */,
|
||||
FullScreen /**< Full screen */,
|
||||
TopEdge /**< Along the top of the screen*/,
|
||||
BottomEdge /**< Along the bottom of the screen*/,
|
||||
LeftEdge /**< Along the left side of the screen */,
|
||||
|
Loading…
Reference in New Issue
Block a user