forked from len0rd/rockbox
Theme Editor: Made touch area position relative to enclosing viewports
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29618 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
fa565048f6
commit
5c47872b9c
3 changed files with 5 additions and 4 deletions
|
@ -28,8 +28,8 @@
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QGraphicsSceneMouseEvent>
|
||||||
|
|
||||||
RBTouchArea::RBTouchArea(int width, int height, QString action,
|
RBTouchArea::RBTouchArea(int width, int height, QString action,
|
||||||
const RBRenderInfo& info)
|
const RBRenderInfo& info, QGraphicsItem* parent)
|
||||||
: QGraphicsItem(info.screen()),
|
: QGraphicsItem(parent),
|
||||||
size(QRectF(0, 0, width, height)), action(action),
|
size(QRectF(0, 0, width, height)), action(action),
|
||||||
device(info.device())
|
device(info.device())
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,7 +31,7 @@ class RBTouchArea : public QGraphicsItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RBTouchArea(int width, int height, QString action,
|
RBTouchArea(int width, int height, QString action,
|
||||||
const RBRenderInfo& info);
|
const RBRenderInfo& info, QGraphicsItem* parent = 0);
|
||||||
virtual ~RBTouchArea();
|
virtual ~RBTouchArea();
|
||||||
|
|
||||||
QRectF boundingRect() const;
|
QRectF boundingRect() const;
|
||||||
|
|
|
@ -930,7 +930,8 @@ bool ParseTreeNode::execTag(const RBRenderInfo& info, RBViewport* viewport)
|
||||||
int width = element->params[2].data.number;
|
int width = element->params[2].data.number;
|
||||||
int height = element->params[3].data.number;
|
int height = element->params[3].data.number;
|
||||||
QString action(element->params[4].data.text);
|
QString action(element->params[4].data.text);
|
||||||
RBTouchArea* temp = new RBTouchArea(width, height, action, info);
|
RBTouchArea* temp = new RBTouchArea(width, height, action, info,
|
||||||
|
viewport);
|
||||||
temp->setPos(x, y);
|
temp->setPos(x, y);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue