forked from len0rd/rockbox
Theme Editor: Fixed some compiler warnings and a segfault. Got some basic text rendering working (only with plaintext elements, no font support yet) as well as Viewport background color support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27126 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
691d049177
commit
273b9d6050
9 changed files with 70 additions and 15 deletions
|
|
@ -21,6 +21,9 @@
|
|||
|
||||
#include "rbfont.h"
|
||||
|
||||
#include <QFont>
|
||||
#include <QBrush>
|
||||
|
||||
RBFont::RBFont(QString file): filename(file)
|
||||
{
|
||||
}
|
||||
|
|
@ -28,3 +31,15 @@ RBFont::RBFont(QString file): filename(file)
|
|||
RBFont::~RBFont()
|
||||
{
|
||||
}
|
||||
|
||||
QGraphicsSimpleTextItem* RBFont::renderText(QString text, QColor color,
|
||||
QGraphicsItem *parent)
|
||||
{
|
||||
QGraphicsSimpleTextItem* retval = new QGraphicsSimpleTextItem(text, parent);
|
||||
QFont font;
|
||||
font.setFixedPitch(true);
|
||||
font.setPixelSize(8);
|
||||
retval->setFont(font);
|
||||
retval->setBrush(QBrush(color));
|
||||
return retval;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue