min/max setters and getters for content size
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=742754
This commit is contained in:
parent
312f42dec0
commit
f73b97780a
32
applet.cpp
32
applet.cpp
@ -925,6 +925,38 @@ QSizeF Applet::contentSizeHint() const
|
||||
return contentSize();
|
||||
}
|
||||
|
||||
void Applet::setMinimumContentSize(const QSizeF &minSize)
|
||||
{
|
||||
int top, left, right, bottom;
|
||||
d->getBorderSize(left, top, right, bottom);
|
||||
|
||||
setMinimumSize(minSize + QSizeF(left + right, top + bottom));
|
||||
}
|
||||
|
||||
QSizeF Applet::minimumContentSize() const
|
||||
{
|
||||
int top, left, right, bottom;
|
||||
d->getBorderSize(left, top, right, bottom);
|
||||
|
||||
return minimumSize() - QSizeF(left + right, top + bottom);
|
||||
}
|
||||
|
||||
void Applet::setMaximumContentSize(const QSizeF &maxSize)
|
||||
{
|
||||
int top, left, right, bottom;
|
||||
d->getBorderSize(left, top, right, bottom);
|
||||
|
||||
setMaximumSize(maxSize + QSizeF(left + right, top + bottom));
|
||||
}
|
||||
|
||||
QSizeF Applet::maximumContentSize() const
|
||||
{
|
||||
int top, left, right, bottom;
|
||||
d->getBorderSize(left, top, right, bottom);
|
||||
|
||||
return maximumSize() - QSizeF(left + right, top + bottom);
|
||||
}
|
||||
|
||||
QString Applet::globalName() const
|
||||
{
|
||||
if (!d->appletDescription.isValid()) {
|
||||
|
20
applet.h
20
applet.h
@ -234,6 +234,26 @@ class PLASMA_EXPORT Applet : public Widget
|
||||
*/
|
||||
virtual QSizeF contentSizeHint() const;
|
||||
|
||||
/**
|
||||
* Sets the minimum size for the content of this applet
|
||||
*/
|
||||
void setMinimumContentSize(const QSizeF &minSize);
|
||||
|
||||
/**
|
||||
* Get the minimum size for the content of this applet
|
||||
*/
|
||||
QSizeF minimumContentSize() const;
|
||||
|
||||
/**
|
||||
* Sets the maximum size for the content of this applet.
|
||||
*/
|
||||
void setMaximumContentSize(const QSizeF &maxSize);
|
||||
|
||||
/**
|
||||
* Get the minimum size for the content of this applet
|
||||
*/
|
||||
QSizeF maximumContentSize() const;
|
||||
|
||||
/**
|
||||
* Returns a list of all known applets.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user