1
0
Fork 0
forked from len0rd/rockbox

Theme Editor: Fixed rendering behavior of default viewport. Now when other viewports are present in the skin, only _text_ from the default viewport is not rendered

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27378 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Bieber 2010-07-11 04:36:05 +00:00
parent a6df932003
commit 364af4f574
2 changed files with 9 additions and 1 deletions

View file

@ -51,7 +51,7 @@ RBViewport::RBViewport(skin_element* node, const RBRenderInfo& info)
if(info.model()->rowCount(QModelIndex()) > 1) if(info.model()->rowCount(QModelIndex()) > 1)
{ {
/* If there is more than one viewport in the document */ /* If there is more than one viewport in the document */
setVisible(false); textOffset.setX(-1);
} }
else else
{ {
@ -175,6 +175,9 @@ void RBViewport::paint(QPainter *painter,
void RBViewport::newLine() void RBViewport::newLine()
{ {
if(textOffset.x() < 0)
return;
if(leftText != "") if(leftText != "")
alignLeft(); alignLeft();
@ -201,6 +204,9 @@ void RBViewport::newLine()
void RBViewport::write(QString text) void RBViewport::write(QString text)
{ {
if(textOffset.x() < 0)
return;
if(textAlign == Left) if(textAlign == Left)
{ {
leftText.append(text); leftText.append(text);

View file

@ -64,6 +64,8 @@ public:
void addTextOffset(int height){ textOffset.setY(textOffset.y() + height); } void addTextOffset(int height){ textOffset.setY(textOffset.y() + height); }
void flushText() void flushText()
{ {
if(textOffset.x() < 0)
return;
alignLeft(); alignLeft();
alignRight(); alignRight();
alignCenter(); alignCenter();