auto resize at most at a third of the screen size.

this is still not perfect (should also take into account the user custom resize)
but avoids the widget being resize to completely ridiculous sizes

svn path=/trunk/KDE/kdelibs/; revision=1206707
This commit is contained in:
Marco Martin 2010-12-15 15:01:19 +00:00
parent 07444819b7
commit 3affa93b86

View File

@ -917,7 +917,13 @@ void ExtenderPrivate::setDisabledBordersHint(const FrameSvg::EnabledBorders bord
void ExtenderPrivate::adjustSize()
{
q->resize(mainWidget->effectiveSizeHint(Qt::PreferredSize));
QRect screenRect;
QSizeF size = mainWidget->effectiveSizeHint(Qt::PreferredSize);
if (applet && applet.data()->containment() && applet.data()->containment()->corona()) {
screenRect = applet.data()->containment()->corona()->screenGeometry(applet.data()->containment()->screen());
}
q->resize(qMin(screenRect.width()/3, (int)size.width()),
qMin(screenRect.height()/3, (int)size.height()));
}
bool Extender::isEmpty() const