* update constraints on immutability changes

* introduce QRectF contentRect() const method so applets can easily get the content rect

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=745244
This commit is contained in:
Aaron J. Seigo 2007-12-05 20:24:40 +00:00
parent 12af5bc729
commit 5c257fce5a
2 changed files with 17 additions and 2 deletions

View File

@ -611,7 +611,13 @@ bool Applet::isKioskImmutable() const
void Applet::setImmutable(bool immutable)
{
if (d->immutable == immutable) {
return;
}
d->immutable = immutable;
// TODO: should we tell the applets too?
updateConstraints(ImmutableConstraint);
}
bool Applet::drawStandardBackground()
@ -913,6 +919,11 @@ Location Applet::location() const
return c->location();
}
QRectF Applet::contentRect() const
{
return QRectF(QPointF(0, 0), contentSize());
}
QSizeF Applet::contentSize() const
{
int top, left, right, bottom;

View File

@ -216,8 +216,12 @@ class PLASMA_EXPORT Applet : public Widget
virtual Location location() const;
/**
* Returns the area within which contents can be painted. If there is no
* background, then this is equivalent to boundingRect().size()
* Returns the rect that the contents are positioned within in local coordinates
*/
QRectF contentRect() const;
/**
* Returns the area within which contents can be painted.
**/
QSizeF contentSize() const;