backport sizing fixes

svn path=/branches/KDE/4.3/kdelibs/; revision=1014444
This commit is contained in:
Marco Martin 2009-08-22 20:50:23 +00:00
parent 70835d7df4
commit 0d117b4792

View File

@ -654,11 +654,20 @@ void AppletHandle::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
// get size limits // get size limits
QSizeF min = m_applet->minimumSize(); QSizeF min = m_applet->minimumSize();
QSizeF max = m_applet->maximumSize(); 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 // If the applet doesn't have a minimum size, calculate based on a
// minimum content area size of 16x16 (KIconLoader::SizeSmall) // minimum content area size of 16x16 (KIconLoader::SizeSmall)
if (min.isEmpty()) { if (1||min.isEmpty()) {
min = m_applet->boundingRect().size() - m_applet->boundingRect().size(); min = m_applet->boundingRect().size() - m_applet->contentsRect().size();
min += QSizeF(KIconLoader::SizeSmall, KIconLoader::SizeSmall); min = QSizeF(KIconLoader::SizeSmall, KIconLoader::SizeSmall);
} }
if (m_pressedButton == RotateButton) { if (m_pressedButton == RotateButton) {