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:
parent
8c41b89090
commit
bfcbfd2662
12
applet.cpp
12
applet.cpp
@ -731,9 +731,21 @@ void Applet::setDrawStandardBackground(bool drawBackground)
|
||||
int left, top, right, bottom;
|
||||
d->getBorderSize(left, top, right, 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());
|
||||
}
|
||||
} 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;
|
||||
d->background = 0;
|
||||
setContentsMargins(0, 0, 0, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user