Exemple #1
0
static int init_view(struct view_info *info,
                     const char *title, const char *text)
{
    rb->viewport_set_defaults(&info->vp, SCREEN_MAIN);
#ifdef HAVE_LCD_BITMAP
    info->pf = rb->font_get(FONT_UI);
    info->display_lines = info->vp.height / info->pf->height;
#else
    info->display_lines = info->vp.height;
#endif

    info->title = title;
    info->text = text;
    info->line_count = 0;
    info->line = 0;
    info->start = 0;

#ifdef HAVE_LCD_BITMAP
    /* no title for small screens. */
    if (info->display_lines < 4)
    {
        info->title = NULL;
    }
    else
    {
        info->display_lines--;
        info->vp.y += info->pf->height;
        info->vp.height -= info->pf->height;
    }
#endif

    calc_line_count(info);
    return 0;
}
Exemple #2
0
static int init_view(struct view_info *info,
                     const char *title, const char *text)
{
#ifdef HAVE_LCD_BITMAP
    info->pf = rb->font_get(FONT_UI);
    info->display_lines = LCD_HEIGHT / info->pf->height;
#else

    info->display_lines = LCD_HEIGHT;
#endif

    info->title = title;
    info->text = text;
    info->line_count = 0;
    info->line = 0;
    info->start = 0;

    /* no title for small screens. */
    if (info->display_lines < 4)
    {
        info->title = NULL;
    }
    else
    {
        info->display_lines--;
    }

    calc_line_count(info);
    return 0;
}