diff options
| author | Robert Bieber <robby@bieberphoto.com> | 2010-07-01 02:29:58 +0000 |
|---|---|---|
| committer | Robert Bieber <robby@bieberphoto.com> | 2010-07-01 02:29:58 +0000 |
| commit | c215d97b4dfdd08a59af20dacb5178087ee230c5 (patch) | |
| tree | 526827bdbb80f42c65c419860e65fa71929f840f /utils | |
| parent | 8cd51a70c58afc67136d889400a0aafe68107ff1 (diff) | |
| download | rockbox-c215d97b4dfdd08a59af20dacb5178087ee230c5.zip rockbox-c215d97b4dfdd08a59af20dacb5178087ee230c5.tar.gz rockbox-c215d97b4dfdd08a59af20dacb5178087ee230c5.tar.bz2 rockbox-c215d97b4dfdd08a59af20dacb5178087ee230c5.tar.xz | |
Theme Editor: Made blank lines render newlines in the output
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27206 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils')
| -rw-r--r-- | utils/themeeditor/graphics/rbviewport.cpp | 5 | ||||
| -rw-r--r-- | utils/themeeditor/graphics/rbviewport.h | 2 | ||||
| -rw-r--r-- | utils/themeeditor/models/parsetreenode.cpp | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/utils/themeeditor/graphics/rbviewport.cpp b/utils/themeeditor/graphics/rbviewport.cpp index 138a6b5..2dd2729 100644 --- a/utils/themeeditor/graphics/rbviewport.cpp +++ b/utils/themeeditor/graphics/rbviewport.cpp @@ -154,11 +154,12 @@ void RBViewport::paint(QPainter *painter, painter->fillRect(QRectF(0, 0, size.width(), 8), statusBarTexture); } -void RBViewport::newLine() +void RBViewport::newLine(bool force) { if(leftText.count() != 0 || centerText.count() != 0 - || rightText.count() != 0) + || rightText.count() != 0 + || force) { textOffset.setY(textOffset.y() + lineHeight); textOffset.setX(0); diff --git a/utils/themeeditor/graphics/rbviewport.h b/utils/themeeditor/graphics/rbviewport.h index 2aff315..ee7d054 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(); + void newLine(bool force = false); 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 fabb578..6d712c8 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(); + viewport->newLine(children.count() > 0 ? false : true); } else if(element->type == TEXT) { |