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
This commit is contained in:
Jason Stubbs 2007-12-24 07:30:17 +00:00
parent c3c755f68b
commit 45c7a63a1f

View File

@ -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