Skip to content

Commit

Permalink
(RGUI) Fix ticker text
Browse files Browse the repository at this point in the history
  • Loading branch information
jdgleaver committed Feb 7, 2019
1 parent c808c80 commit b27c23f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
15 changes: 10 additions & 5 deletions menu/drivers/rgui.c
Original file line number Diff line number Diff line change
Expand Up @@ -1588,7 +1588,8 @@ static void rgui_render(void *data, bool is_idle)
ticker.idx = menu_animation_get_ticker_time();
ticker.str = rgui->thumbnail_content;
ticker.selected = true;
menu_animation_ticker(&ticker);
if (menu_animation_ticker(&ticker))
rgui->force_redraw = true;

title_width = utf8len(thumbnail_title_buf) * FONT_WIDTH_STRIDE;
title_x = RGUI_TERM_START_X(fb_width) + ((RGUI_TERM_WIDTH(fb_width) * FONT_WIDTH_STRIDE) - title_width) / 2;
Expand Down Expand Up @@ -1623,7 +1624,8 @@ static void rgui_render(void *data, bool is_idle)
ticker.str = title;
ticker.selected = true;

menu_animation_ticker(&ticker);
if (menu_animation_ticker(&ticker))
rgui->force_redraw = true;

string_to_upper(title_buf);

Expand All @@ -1643,7 +1645,8 @@ static void rgui_render(void *data, bool is_idle)
ticker.str = core_title;
ticker.selected = true;

menu_animation_ticker(&ticker);
if (menu_animation_ticker(&ticker))
rgui->force_redraw = true;

if (rgui_framebuf_data)
blit_line(
Expand Down Expand Up @@ -1713,13 +1716,15 @@ static void rgui_render(void *data, bool is_idle)
ticker.str = entry_path;
ticker.selected = entry_selected;

menu_animation_ticker(&ticker);
if (menu_animation_ticker(&ticker))
rgui->force_redraw = true;

ticker.s = type_str_buf;
ticker.len = entry_spacing;
ticker.str = entry_value;

menu_animation_ticker(&ticker);
if (menu_animation_ticker(&ticker))
rgui->force_redraw = true;

entry_title_buf_utf8len = utf8len(entry_title_buf);
entry_title_buf_len = strlen(entry_title_buf);
Expand Down
6 changes: 3 additions & 3 deletions menu/menu_animation.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,14 +566,14 @@ bool menu_animation_ticker(const menu_animation_ctx_ticker_t *ticker)
PATH_MAX_LENGTH,
ticker->str,
ticker->len);
return true;
return false;
}

if (!ticker->selected)
{
utf8cpy(ticker->s, PATH_MAX_LENGTH, ticker->str, ticker->len - 3);
strlcat(ticker->s, "...", PATH_MAX_LENGTH);
return true;
return false;
}

if (str_len > ticker->len)
Expand Down Expand Up @@ -747,4 +747,4 @@ void menu_timer_kill(menu_timer_t *timer)
float menu_animation_get_ticker_time()
{
return ticker_time;
}
}

0 comments on commit b27c23f

Please sign in to comment.