From 14caf676424f2c2a5ce44c69d41862660fa71be6 Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Fri, 2 Jul 2010 05:17:57 +0000 Subject: Theme Editor: Switched the last two parameters of the Vp tag back to their original orientation, made the playlist display the first half with ID3 info, the second half without, as if the list were mid-way through loading git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27234 a1c6a512-1295-4272-9138-f99709370657 --- utils/themeeditor/graphics/rbviewport.cpp | 15 +++++++++++---- utils/themeeditor/graphics/rbviewport.h | 4 ---- utils/themeeditor/models/parsetreenode.cpp | 12 +++--------- utils/themeeditor/resources/deviceoptions | 1 - 4 files changed, 14 insertions(+), 18 deletions(-) (limited to 'utils') diff --git a/utils/themeeditor/graphics/rbviewport.cpp b/utils/themeeditor/graphics/rbviewport.cpp index 5197c2edc6..a2e7bf49d3 100644 --- a/utils/themeeditor/graphics/rbviewport.cpp +++ b/utils/themeeditor/graphics/rbviewport.cpp @@ -34,7 +34,7 @@ RBViewport::RBViewport(skin_element* node, const RBRenderInfo& info) foreground(info.screen()->foreground()), background(info.screen()->background()), textOffset(0,0), screen(info.screen()), textAlign(Left), showStatusBar(false), - statusBarTexture(":/render/statusbar.png"), line(node->line) + statusBarTexture(":/render/statusbar.png") { if(!node->tag) { @@ -187,17 +187,24 @@ void RBViewport::showPlaylist(const RBRenderInfo &info, int start, skin_element *id3, skin_element *noId3) { /* Determining whether ID3 info is available */ - skin_element* root = info.device()->data("id3available").toBool() - ? id3 : noId3; + skin_element* root = id3; /* The line will be a linked list */ - root = root->children[0]; + if(root->children_count > 0) + root = root->children[0]; int song = start + info.device()->data("pp").toInt(); int numSongs = info.device()->data("pe").toInt(); + int halfWay = (numSongs - song) / 2 + 1 + song; while(song <= numSongs && textOffset.y() + lineHeight < size.height()) { + if(song == halfWay) + { + root = noId3; + if(root->children_count > 0) + root = root->children[0]; + } skin_element* current = root; while(current) { diff --git a/utils/themeeditor/graphics/rbviewport.h b/utils/themeeditor/graphics/rbviewport.h index 37c642574f..624a9686da 100644 --- a/utils/themeeditor/graphics/rbviewport.h +++ b/utils/themeeditor/graphics/rbviewport.h @@ -66,8 +66,6 @@ public: void showPlaylist(const RBRenderInfo& info, int start, skin_element* id3, skin_element* noId3); - int declarationLine(){ return line; } - private: void alignLeft(); @@ -93,8 +91,6 @@ private: bool showStatusBar; QPixmap statusBarTexture; - - int line; }; #endif // RBVIEWPORT_H diff --git a/utils/themeeditor/models/parsetreenode.cpp b/utils/themeeditor/models/parsetreenode.cpp index f786819b17..08ce703859 100644 --- a/utils/themeeditor/models/parsetreenode.cpp +++ b/utils/themeeditor/models/parsetreenode.cpp @@ -518,13 +518,7 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport, { for(int i = 0; i < children.count(); i++) children[i]->render(info, viewport); - /* TODO - * The second element of this if is a temporary hack to allow Vf and Vb - * tags in a viewport without forcing the first line of text down. A - * proper solution to this problem needs to be worked out in the parser - * as soon as possible - */ - if(!noBreak && element->line != viewport->declarationLine()) + if(!noBreak) viewport->newLine(); } else if(element->type == TEXT) @@ -787,8 +781,8 @@ bool ParseTreeNode::execTag(const RBRenderInfo& info, RBViewport* viewport) case 'p': /* %Vp */ viewport->showPlaylist(info, element->params[0].data.numeric, - element->params[2].data.code, - element->params[1].data.code); + element->params[1].data.code, + element->params[2].data.code); return true; case 'I': diff --git a/utils/themeeditor/resources/deviceoptions b/utils/themeeditor/resources/deviceoptions index 5417ca6b2d..10a1a89d75 100644 --- a/utils/themeeditor/resources/deviceoptions +++ b/utils/themeeditor/resources/deviceoptions @@ -114,7 +114,6 @@ ra ; Autoscore ; spin(0,10) ; 7 ?C ; Album Art Available ; check ; true artwidth ; Album Art Width ; spin(0,500) ; 100 artheight; Album Art Height ; spin(0,500) ; 100 -id3available ; ID3 Info Available ; check ; true [Hardware Status] bl ; Battery Level (-1 for unknown) ; spin(-1,100) ; 50 -- cgit v1.2.3