summaryrefslogtreecommitdiff
path: root/utils/themeeditor/graphics/rbmovable.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-08-04 09:16:52 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-08-04 09:16:52 +0000
commit49865b23f601e636c9a80b21826fc607f1964eb5 (patch)
treeeb7959fd8aa5c572842e8d295440348cb17fc3cf /utils/themeeditor/graphics/rbmovable.cpp
parent2db08d41536b875f35b055f8e0bb3845b47a7ba3 (diff)
downloadrockbox-49865b23f601e636c9a80b21826fc607f1964eb5.tar.gz
rockbox-49865b23f601e636c9a80b21826fc607f1964eb5.zip
Theme Editor: Began implementing code generation for movable viewports
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27691 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/graphics/rbmovable.cpp')
-rw-r--r--utils/themeeditor/graphics/rbmovable.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/utils/themeeditor/graphics/rbmovable.cpp b/utils/themeeditor/graphics/rbmovable.cpp
index 11b3a6812f..3eca8bd18c 100644
--- a/utils/themeeditor/graphics/rbmovable.cpp
+++ b/utils/themeeditor/graphics/rbmovable.cpp
@@ -25,7 +25,7 @@
25#include "rbmovable.h" 25#include "rbmovable.h"
26 26
27RBMovable::RBMovable(QGraphicsItem* parent) 27RBMovable::RBMovable(QGraphicsItem* parent)
28 : QGraphicsItem(parent) 28 : QGraphicsItem(parent), geomChanged(false)
29{ 29{
30 setFlags(ItemIsMovable | ItemIsSelectable | ItemSendsGeometryChanges); 30 setFlags(ItemIsMovable | ItemIsSelectable | ItemSendsGeometryChanges);
31} 31}
@@ -61,7 +61,7 @@ QVariant RBMovable::itemChange(GraphicsItemChange change, const QVariant &value)
61 pos.setY(qMax(0., pos.y())); 61 pos.setY(qMax(0., pos.y()));
62 pos.setY(qMin(pos.y(), bound.height() - boundingRect().height())); 62 pos.setY(qMin(pos.y(), bound.height() - boundingRect().height()));
63 63
64 saveGeometry(); 64 geomChanged = true;
65 65
66 return pos; 66 return pos;
67 } 67 }
@@ -69,3 +69,17 @@ QVariant RBMovable::itemChange(GraphicsItemChange change, const QVariant &value)
69 return QGraphicsItem::itemChange(change, value); 69 return QGraphicsItem::itemChange(change, value);
70} 70}
71 71
72void RBMovable::mousePressEvent(QGraphicsSceneMouseEvent *event)
73{
74 QGraphicsItem::mousePressEvent(event);
75}
76
77void RBMovable::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
78{
79 QGraphicsItem::mouseReleaseEvent(event);
80 if(isSelected())
81 {
82 saveGeometry();
83 geomChanged = false;
84 }
85}