forked from len0rd/rockbox
Theme Editor: Created the RBMovable abstract class for screen elements that can be moved around, began implementing it and making images, viewports, and album art children of it
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27685 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
851be21f67
commit
83c60a1012
10 changed files with 166 additions and 29 deletions
|
@ -26,7 +26,7 @@
|
|||
#include "rbimage.h"
|
||||
|
||||
RBImage::RBImage(QString file, int tiles, int x, int y, QGraphicsItem* parent)
|
||||
: QGraphicsItem(parent), tiles(tiles), currentTile(0)
|
||||
: RBMovable(parent), tiles(tiles), currentTile(0)
|
||||
{
|
||||
if(QFile::exists(file))
|
||||
{
|
||||
|
@ -56,7 +56,7 @@ RBImage::RBImage(QString file, int tiles, int x, int y, QGraphicsItem* parent)
|
|||
}
|
||||
|
||||
RBImage::RBImage(const RBImage &other, QGraphicsItem* parent)
|
||||
: QGraphicsItem(parent), tiles(other.tiles), currentTile(other.currentTile)
|
||||
: RBMovable(parent), tiles(other.tiles), currentTile(other.currentTile)
|
||||
{
|
||||
if(other.image)
|
||||
image = new QPixmap(*(other.image));
|
||||
|
@ -86,4 +86,11 @@ void RBImage::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|||
painter->drawPixmap(size, *image, QRect(0, currentTile * image->height()
|
||||
/ tiles, image->width(),
|
||||
image->height() / tiles));
|
||||
|
||||
RBMovable::paint(painter, option, widget);
|
||||
}
|
||||
|
||||
void RBImage::saveGeometry()
|
||||
{
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue