forked from len0rd/rockbox
make the next line after a viewport (if it is on the same skin line) auto-eat the \n
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26837 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7b59f99a72
commit
3f5851f41f
2 changed files with 18 additions and 2 deletions
|
@ -123,7 +123,22 @@ int handle_tree(struct skin *skin, struct skin_element* tree, struct line *line)
|
|||
int counter;
|
||||
while (element)
|
||||
{
|
||||
if (element->type == LINE)
|
||||
if (element->type == VIEWPORT)
|
||||
{
|
||||
struct skin_element *next;
|
||||
/* parse the viewport */
|
||||
/* if the next element is a LINE we need to set it to eat the line ending */
|
||||
next = element->children[0];
|
||||
if (element->tag && next->type == LINE &&
|
||||
element->line == next->line)
|
||||
{
|
||||
struct line *line = (struct line*)malloc(sizeof(struct line));
|
||||
line->update_mode = 0;
|
||||
line->eat_line_ending = true;
|
||||
next->data = line;
|
||||
}
|
||||
}
|
||||
else if (element->type == LINE && !element->data)
|
||||
{
|
||||
struct line *line = (struct line*)malloc(sizeof(struct line));
|
||||
line->update_mode = 0;
|
||||
|
@ -164,6 +179,7 @@ int handle_tree(struct skin *skin, struct skin_element* tree, struct line *line)
|
|||
int ret = handle_tree(skin, element->children[counter], current_line);
|
||||
counter++;
|
||||
}
|
||||
/* *probably* set current_line to NULL here */
|
||||
element = element->next;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -111,7 +111,7 @@ void skin_render_viewport(struct skin_element* viewport, bool draw_tags)
|
|||
func(line, linebuf, sizeof(linebuf), line_number);
|
||||
if (draw_tags)
|
||||
{
|
||||
printf("%s", linebuf);
|
||||
printf("[%d]%s", line_number, linebuf);
|
||||
if (!((struct line*)line->data)->eat_line_ending)
|
||||
{
|
||||
printf("\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue