summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-01 20:30:19 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-01 20:30:19 +0000
commita54bfaa69e33b22e8c872298103c5f07d4d59dc5 (patch)
treec546accfe7ec80d2797782208956ebb6b331b671
parenta43fbbb9a39917f409d7d28b3bba5cfdd8603139 (diff)
downloadrockbox-a54bfaa69e33b22e8c872298103c5f07d4d59dc5.tar.gz
rockbox-a54bfaa69e33b22e8c872298103c5f07d4d59dc5.zip
Theme Editor: Renderer now adds a newline after EVERY logical line in the parse tree
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27222 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--utils/themeeditor/graphics/rbviewport.cpp20
-rw-r--r--utils/themeeditor/graphics/rbviewport.h2
-rw-r--r--utils/themeeditor/models/parsetreenode.cpp2
3 files changed, 9 insertions, 15 deletions
diff --git a/utils/themeeditor/graphics/rbviewport.cpp b/utils/themeeditor/graphics/rbviewport.cpp
index 2dd272927e..d4a8ede090 100644
--- a/utils/themeeditor/graphics/rbviewport.cpp
+++ b/utils/themeeditor/graphics/rbviewport.cpp
@@ -154,20 +154,14 @@ void RBViewport::paint(QPainter *painter,
painter->fillRect(QRectF(0, 0, size.width(), 8), statusBarTexture);
}
-void RBViewport::newLine(bool force)
+void RBViewport::newLine()
{
- if(leftText.count() != 0
- || centerText.count() != 0
- || rightText.count() != 0
- || force)
- {
- textOffset.setY(textOffset.y() + lineHeight);
- textOffset.setX(0);
- textAlign = Left;
- leftText.clear();
- rightText.clear();
- centerText.clear();
- }
+ textOffset.setY(textOffset.y() + lineHeight);
+ textOffset.setX(0);
+ textAlign = Left;
+ leftText.clear();
+ rightText.clear();
+ centerText.clear();
}
void RBViewport::write(QString text)
diff --git a/utils/themeeditor/graphics/rbviewport.h b/utils/themeeditor/graphics/rbviewport.h
index ee7d0540eb..2aff315873 100644
--- a/utils/themeeditor/graphics/rbviewport.h
+++ b/utils/themeeditor/graphics/rbviewport.h
@@ -53,7 +53,7 @@ public:
void makeCustomUI(){ customUI = true; }
void clearCustomUI(){ customUI = false; }
- void newLine(bool force = false);
+ void newLine();
void write(QString text);
void alignText(Alignment align){ textAlign = align; }
diff --git a/utils/themeeditor/models/parsetreenode.cpp b/utils/themeeditor/models/parsetreenode.cpp
index 8edbbe9b6c..d10bb08936 100644
--- a/utils/themeeditor/models/parsetreenode.cpp
+++ b/utils/themeeditor/models/parsetreenode.cpp
@@ -518,7 +518,7 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport,
for(int i = 0; i < children.count(); i++)
children[i]->render(info, viewport);
if(!noBreak)
- viewport->newLine(children.count() > 0 ? false : true);
+ viewport->newLine();
}
else if(element->type == TEXT)
{