forked from len0rd/rockbox
Theme Editor: Began implementing code generation for movable viewports
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27691 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2db08d4153
commit
49865b23f6
12 changed files with 104 additions and 23 deletions
|
@ -25,7 +25,7 @@
|
|||
#include "rbmovable.h"
|
||||
|
||||
RBMovable::RBMovable(QGraphicsItem* parent)
|
||||
: QGraphicsItem(parent)
|
||||
: QGraphicsItem(parent), geomChanged(false)
|
||||
{
|
||||
setFlags(ItemIsMovable | ItemIsSelectable | ItemSendsGeometryChanges);
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ QVariant RBMovable::itemChange(GraphicsItemChange change, const QVariant &value)
|
|||
pos.setY(qMax(0., pos.y()));
|
||||
pos.setY(qMin(pos.y(), bound.height() - boundingRect().height()));
|
||||
|
||||
saveGeometry();
|
||||
geomChanged = true;
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
@ -69,3 +69,17 @@ QVariant RBMovable::itemChange(GraphicsItemChange change, const QVariant &value)
|
|||
return QGraphicsItem::itemChange(change, value);
|
||||
}
|
||||
|
||||
void RBMovable::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
QGraphicsItem::mousePressEvent(event);
|
||||
}
|
||||
|
||||
void RBMovable::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
if(isSelected())
|
||||
{
|
||||
saveGeometry();
|
||||
geomChanged = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue