Fix a bug when a plasmoid could be resized to a smaller value than it's minimumSize
svn path=/trunk/KDE/kdelibs/; revision=1057530
This commit is contained in:
parent
bf404da15e
commit
7e35361bf4
@ -711,10 +711,17 @@ void AppletHandle::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
if (m_pressedButton == ResizeButton) {
|
||||
// set applet size
|
||||
//kDebug() << newCenter << m_originalGeom.topLeft() << newSize;
|
||||
QPointF newPos = m_originalGeom.topLeft() + _k_rotatePoint(newCenter, m_angle);
|
||||
m_applet->setPos(newPos);
|
||||
// m_applet->moveBy(newCenter.x(), newCenter.y());
|
||||
m_applet->resize(newSize.x(), newSize.y());
|
||||
|
||||
// Prevent the plasmoid from resizing itself to a smaller value than the minimumsize
|
||||
if (newSize.x() > m_applet->minimumSize().width() &&
|
||||
newSize.y() > m_applet->minimumSize().height() &&
|
||||
newSize.x() > m_applet->effectiveSizeHint(Qt::MinimumSize).width() &&
|
||||
newSize.y() > m_applet->effectiveSizeHint(Qt::MinimumSize).height()) {
|
||||
QPointF newPos = m_originalGeom.topLeft() + _k_rotatePoint(newCenter, m_angle);
|
||||
m_applet->setPos(newPos);
|
||||
// m_applet->moveBy(newCenter.x(), newCenter.y());
|
||||
m_applet->resize(newSize.x(), newSize.y());
|
||||
}
|
||||
} else {
|
||||
// set applet handle rotation - rotate around center of applet
|
||||
QRectF appletGeomLocal = m_originalGeom;
|
||||
|
Loading…
x
Reference in New Issue
Block a user