allow moving on any part of the applet surface; it seems our widgets still work just fine with this which is pretty cool; in this case i like the event model for QGV =)

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=738454
This commit is contained in:
Aaron J. Seigo 2007-11-18 23:03:57 +00:00
parent bcb4268c19
commit 997f9e75a8
2 changed files with 3 additions and 7 deletions

View File

@ -196,18 +196,14 @@ AppletHandle::ButtonType AppletHandle::mapToButton(const QPointF &point) const
return RemoveButton;
}
return m_applet->mapToParent(m_applet->shape()).contains(point) ? NoButton : MoveButton;
return MoveButton;
//return m_applet->mapToParent(m_applet->shape()).contains(point) ? NoButton : MoveButton;
}
void AppletHandle::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton) {
m_pressedButton = mapToButton(event->pos());
if (m_pressedButton == NoButton) {
// since drag is everywhere there isn't a button, NoButton clicks mean the applet
}
event->accept();
update();
return;

View File

@ -182,7 +182,7 @@ class Svg::Private
QSizeF naturalSize = renderer->defaultSize();
qreal dx = size.width() / naturalSize.width();
qreal dy = size.height() / naturalSize.height();
return QRect(elementRect.x() * dx, elementRect.y() * dy,
elementRect.width() * dx, elementRect.height() * dy);
}