From 45c7a63a1f480bd7f3b8f77470d6c3203249f8c5 Mon Sep 17 00:00:00 2001 From: Jason Stubbs Date: Mon, 24 Dec 2007 07:30:17 +0000 Subject: [PATCH] If an applet doesn't have a minimum size hint, calculate a minimum size where its content area is a minimum of 16x16 svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=752324 --- applethandle.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/applethandle.cpp b/applethandle.cpp index 001646380..a0f577461 100644 --- a/applethandle.cpp +++ b/applethandle.cpp @@ -340,6 +340,13 @@ void AppletHandle::mouseMoveEvent(QGraphicsSceneMouseEvent *event) QSizeF min = m_applet->minimumSize(); QSizeF max = m_applet->maximumSize(); + // If the applet doesn't have a minimum size, calculate based on a + // minimum content area size of 16x16 + if (min.isEmpty()) { + min = m_applet->boundingRect().size() - m_applet->contentRect().size(); + min += QSizeF(16, 16); + } + //FIXME: this code will only work if we are keeping the aspect ratio, as we currently do // as it resets only on the width, which will break if we allow resizing of width // and height independantly