Theme Editor: Renderer will not insert a newline at the end of a line if it's the same line in the wps file as the viewport declaration, to avoid forcing the first line of text down past where it belongs if Vf and Vb are used. The parser should be modified to make this unnecessary, when a consensus can be reached on how to do it

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27230 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Bieber 2010-07-02 00:27:47 +00:00
parent 9742704070
commit f58174f7cc
3 changed files with 12 additions and 2 deletions

View file

@ -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")
statusBarTexture(":/render/statusbar.png"), line(node->line)
{
if(!node->tag)
{

View file

@ -66,6 +66,8 @@ public:
void showPlaylist(const RBRenderInfo& info, int start, skin_element* id3,
skin_element* noId3);
int declarationLine(){ return line; }
private:
void alignLeft();
@ -91,6 +93,8 @@ private:
bool showStatusBar;
QPixmap statusBarTexture;
int line;
};
#endif // RBVIEWPORT_H

View file

@ -518,7 +518,13 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport,
{
for(int i = 0; i < children.count(); i++)
children[i]->render(info, viewport);
if(!noBreak)
/* 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())
viewport->newLine();
}
else if(element->type == TEXT)