1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 15:38:11 +00:00

modtrezorui: introduce TREZOR_FONT_PREFILL, set it to 0 in bootloader

This commit is contained in:
Pavol Rusnak 2018-01-02 01:37:31 +01:00
parent 424115967f
commit 94588dd588
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
3 changed files with 10 additions and 0 deletions

View File

@ -34,6 +34,7 @@ SOURCE_MOD += [
# modtrezorui
CPPDEFINES_MOD += [
'TREZOR_FONT_BOLD_ENABLE',
('TREZOR_FONT_PREFILL', '0'),
('QR_MAX_VERSION', '0'),
]
SOURCE_MOD += [

View File

@ -463,9 +463,11 @@ void display_text(int x, int y, const char *text, int textlen, uint8_t font, uin
{
x += DISPLAY_OFFSET[0];
y += DISPLAY_OFFSET[1];
#if TREZOR_FONT_PREFILL
int w = display_text_width(text, textlen, font);
int barwidth = max(w, minwidth);
display_bar(x - 1, y - 18, barwidth + 2, 23, bgcolor);
#endif
display_text_render(x, y, text, textlen, font, fgcolor, bgcolor);
}
@ -474,8 +476,10 @@ void display_text_center(int x, int y, const char *text, int textlen, uint8_t fo
x += DISPLAY_OFFSET[0];
y += DISPLAY_OFFSET[1];
int w = display_text_width(text, textlen, font);
#if TREZOR_FONT_PREFILL
int barwidth = max(w, minwidth);
display_bar(x - barwidth / 2 - 1, y - 18, barwidth + 2, 23, bgcolor);
#endif
display_text_render(x - w / 2, y, text, textlen, font, fgcolor, bgcolor);
}
@ -484,8 +488,10 @@ void display_text_right(int x, int y, const char *text, int textlen, uint8_t fon
x += DISPLAY_OFFSET[0];
y += DISPLAY_OFFSET[1];
int w = display_text_width(text, textlen, font);
#if TREZOR_FONT_PREFILL
int barwidth = max(w, minwidth);
display_bar(x - barwidth - 1, y - 18, barwidth + 2, 23, bgcolor);
#endif
display_text_render(x - w, y, text, textlen, font, fgcolor, bgcolor);
}

View File

@ -29,6 +29,9 @@
#ifdef TREZOR_FONT_BOLD_ENABLE
#define FONT_BOLD 2
#endif
#ifndef TREZOR_FONT_PREFILL
#define TREZOR_FONT_PREFILL 1
#endif
#define AVATAR_IMAGE_SIZE 144
#define LOADER_ICON_SIZE 64