restoring the minimum size alteration in setDrawStandardBackground()

but now when standard background is disabled the minimum size shrinks.
now some applets are starting to look good on the desktop, for instance
tasks, but not pager or clock

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=798173
This commit is contained in:
Marco Martin 2008-04-17 17:49:33 +00:00
parent 8c41b89090
commit bfcbfd2662

View File

@ -731,9 +731,21 @@ void Applet::setDrawStandardBackground(bool drawBackground)
int left, top, right, bottom; int left, top, right, bottom;
d->getBorderSize(left, top, right, bottom); d->getBorderSize(left, top, right, bottom);
setContentsMargins(left, right, top, bottom); setContentsMargins(left, right, top, bottom);
QSizeF fitSize(left + right, top + bottom);
if (minimumSize().expandedTo(fitSize) != minimumSize()) {
setMinimumSize(minimumSize().expandedTo(fitSize));
}
d->background->resize(boundingRect().size()); d->background->resize(boundingRect().size());
} }
} else if (d->background) { } else if (d->background) {
int left, top, right, bottom;
d->getBorderSize(left, top, right, bottom);
//Setting a minimum size of 0,0 would result in the panel to be only
//on the first virtual desktop
setMinimumSize(qMax(minimumSize().width() - left - right, 1.0),
qMax(minimumSize().height() - top - bottom, 1.0));
delete d->background; delete d->background;
d->background = 0; d->background = 0;
setContentsMargins(0, 0, 0, 0); setContentsMargins(0, 0, 0, 0);