From 0d117b4792f8f264012253c4285e878ce93d89fe Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sat, 22 Aug 2009 20:50:23 +0000 Subject: [PATCH] backport sizing fixes svn path=/branches/KDE/4.3/kdelibs/; revision=1014444 --- private/applethandle.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/private/applethandle.cpp b/private/applethandle.cpp index 22e4613d8..d7f5e898b 100644 --- a/private/applethandle.cpp +++ b/private/applethandle.cpp @@ -654,11 +654,20 @@ void AppletHandle::mouseMoveEvent(QGraphicsSceneMouseEvent *event) // get size limits QSizeF min = m_applet->minimumSize(); QSizeF max = m_applet->maximumSize(); + + if (min.isEmpty()) { + min = m_applet->effectiveSizeHint(Qt::MinimumSize); + } + + if (max.isEmpty()) { + max = m_applet->effectiveSizeHint(Qt::MaximumSize); + } + // If the applet doesn't have a minimum size, calculate based on a // minimum content area size of 16x16 (KIconLoader::SizeSmall) - if (min.isEmpty()) { - min = m_applet->boundingRect().size() - m_applet->boundingRect().size(); - min += QSizeF(KIconLoader::SizeSmall, KIconLoader::SizeSmall); + if (1||min.isEmpty()) { + min = m_applet->boundingRect().size() - m_applet->contentsRect().size(); + min = QSizeF(KIconLoader::SizeSmall, KIconLoader::SizeSmall); } if (m_pressedButton == RotateButton) {