* 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:
parent
12af5bc729
commit
5c257fce5a
11
applet.cpp
11
applet.cpp
@ -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;
|
||||
|
8
applet.h
8
applet.h
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user