Sets on Applet::constraintsUpdated() the maximum content width for horizontal panels and the maximum content height for vertical panels as IconSize(KIconLoader::Panel)

this makes vertical larger panels actually usable. 

Some notes:
-it works only for applets that aren't forced to square 
-in horizontal panels only for applets that don't have expandingDirections()=Qt::Horizontal  
-in vertical panels only for applets that don't have expandingDirections()=Qt::Vertical

On other news the kickoff applets are modified to use this new feature

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=770423
This commit is contained in:
Marco Martin 2008-02-03 18:21:01 +00:00
parent 2434a31f69
commit dfb3854a10

View File

@ -581,6 +581,16 @@ void Applet::constraintsUpdated(Plasma::Constraints constraints)
{
Q_UNUSED(constraints)
//kDebug() << constraints << "constraints are FormFactor: " << formFactor() << ", Location: " << location();
if ((constraints & Plasma::FormFactorConstraint) && !d->square) {
if (formFactor() == Plasma::Vertical && !(expandingDirections()&Qt::Vertical) ) {
setMaximumContentSize(QSizeF(maximumContentSize().width(), IconSize(KIconLoader::Panel)));
}else if (formFactor() == Plasma::Horizontal && !(expandingDirections()&Qt::Horizontal)) {
setMaximumContentSize(QSizeF(IconSize(KIconLoader::Panel), maximumContentSize().height()));
} else {
setMaximumContentSize(QSizeF(std::numeric_limits<qreal>::infinity(),
std::numeric_limits<qreal>::infinity()));
}
}
}
QString Applet::name() const