forked from len0rd/rockbox
Theme Editor: Implemented saveGeometry() in RBAlbumArt
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27713 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2ea1a34f98
commit
265ee156f2
4 changed files with 25 additions and 6 deletions
|
@ -23,15 +23,19 @@
|
|||
|
||||
#include <QPainter>
|
||||
|
||||
#include "parsetreenode.h"
|
||||
|
||||
RBAlbumArt::RBAlbumArt(QGraphicsItem *parent, int x, int y, int maxWidth,
|
||||
int maxHeight, int artWidth, int artHeight, char hAlign,
|
||||
char vAlign)
|
||||
int maxHeight, int artWidth, int artHeight,
|
||||
ParseTreeNode* node, char hAlign, char vAlign)
|
||||
: RBMovable(parent), size(0, 0, maxWidth,
|
||||
maxHeight),
|
||||
artWidth(artWidth), artHeight(artHeight),
|
||||
hAlign(hAlign), vAlign(vAlign),
|
||||
texture(":/render/albumart.png")
|
||||
texture(":/render/albumart.png"), node(node)
|
||||
{
|
||||
setFlag(ItemSendsGeometryChanges, false);
|
||||
|
||||
setPos(x, y);
|
||||
hide();
|
||||
}
|
||||
|
@ -99,4 +103,11 @@ void RBAlbumArt::paint(QPainter *painter,
|
|||
void RBAlbumArt::saveGeometry()
|
||||
{
|
||||
|
||||
QPointF origin = pos();
|
||||
QRectF bounds = boundingRect();
|
||||
|
||||
node->modParam(static_cast<int>(origin.x()), 0);
|
||||
node->modParam(static_cast<int>(origin.y()), 1);
|
||||
node->modParam(static_cast<int>(bounds.width()), 2);
|
||||
node->modParam(static_cast<int>(bounds.height()), 3);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue