From bfcbfd266219511cce3ed88b35a108c44741cc6f Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 17 Apr 2008 17:49:33 +0000 Subject: [PATCH] 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 --- applet.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/applet.cpp b/applet.cpp index 5a0431eb2..5da3f53cb 100644 --- a/applet.cpp +++ b/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);