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:
parent
bcb4268c19
commit
997f9e75a8
@ -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;
|
||||
|
2
svg.cpp
2
svg.cpp
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user