summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/skin_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine/skin_parser.c')
-rw-r--r--apps/gui/skin_engine/skin_parser.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 3238c48c63..1945bfbc57 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -589,20 +589,22 @@ static int parse_viewporttextstyle(struct skin_element *element,
589 struct wps_data *wps_data) 589 struct wps_data *wps_data)
590{ 590{
591 (void)wps_data; 591 (void)wps_data;
592 int style;
593 char *mode = get_param_text(element, 0); 592 char *mode = get_param_text(element, 0);
593 struct line_desc *line = skin_buffer_alloc(sizeof(*line));
594 *line = (struct line_desc)LINE_DESC_DEFINIT;
594 unsigned colour; 595 unsigned colour;
595 596
596 if (!strcmp(mode, "invert")) 597 if (!strcmp(mode, "invert"))
597 { 598 {
598 style = STYLE_INVERT; 599 line->style = STYLE_INVERT;
599 } 600 }
600 else if (!strcmp(mode, "colour") || !strcmp(mode, "color")) 601 else if (!strcmp(mode, "colour") || !strcmp(mode, "color"))
601 { 602 {
602 if (element->params_count < 2 || 603 if (element->params_count < 2 ||
603 !parse_color(curr_screen, get_param_text(element, 1), &colour)) 604 !parse_color(curr_screen, get_param_text(element, 1), &colour))
604 return 1; 605 return 1;
605 style = STYLE_COLORED|(STYLE_COLOR_MASK&colour); 606 line->style = STYLE_COLORED;
607 line->text_color = colour;
606 } 608 }
607#ifdef HAVE_LCD_COLOR 609#ifdef HAVE_LCD_COLOR
608 else if (!strcmp(mode, "gradient")) 610 else if (!strcmp(mode, "gradient"))
@@ -614,16 +616,18 @@ static int parse_viewporttextstyle(struct skin_element *element,
614 * will select the number for something which looks like a colour 616 * will select the number for something which looks like a colour
615 * making the "colour" case (above) harder to parse */ 617 * making the "colour" case (above) harder to parse */
616 num_lines = atoi(get_param_text(element, 1)); 618 num_lines = atoi(get_param_text(element, 1));
617 style = STYLE_GRADIENT|NUMLN_PACK(num_lines)|CURLN_PACK(0); 619 line->style = STYLE_GRADIENT;
620 line->nlines = num_lines;
618 } 621 }
619#endif 622#endif
620 else if (!strcmp(mode, "clear")) 623 else if (!strcmp(mode, "clear"))
621 { 624 {
622 style = STYLE_DEFAULT; 625 line->style = STYLE_DEFAULT;
623 } 626 }
624 else 627 else
625 return 1; 628 return 1;
626 token->value.l = style; 629
630 token->value.data = PTRTOSKINOFFSET(skin_buffer, line);
627 return 0; 631 return 0;
628} 632}
629 633