mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-13 19:18:56 +00:00
trezor.ui: introduce ui.SIZE
This commit is contained in:
parent
965bf84cdb
commit
4584861385
@ -18,6 +18,7 @@
|
||||
#define DISPLAY_RESY 240
|
||||
|
||||
#define FONT_BPP 4
|
||||
#define FONT_SIZE 20
|
||||
|
||||
#ifdef TREZOR_FONT_MONO_ENABLE
|
||||
#define FONT_MONO 0
|
||||
|
@ -423,6 +423,9 @@ STATIC const mp_rom_map_elem_t mod_trezorui_Display_locals_dict_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR_backlight), MP_ROM_PTR(&mod_trezorui_Display_backlight_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_offset), MP_ROM_PTR(&mod_trezorui_Display_offset_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_save), MP_ROM_PTR(&mod_trezorui_Display_save_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_WIDTH), MP_OBJ_NEW_SMALL_INT(DISPLAY_RESX) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_HEIGHT), MP_OBJ_NEW_SMALL_INT(DISPLAY_RESY) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_FONT_SIZE), MP_OBJ_NEW_SMALL_INT(FONT_SIZE) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_FONT_MONO), MP_OBJ_NEW_SMALL_INT(FONT_MONO) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_FONT_NORMAL), MP_OBJ_NEW_SMALL_INT(FONT_NORMAL) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_FONT_BOLD), MP_OBJ_NEW_SMALL_INT(FONT_BOLD) },
|
||||
|
@ -16,13 +16,13 @@ display = Display()
|
||||
if sys.platform != 'trezor':
|
||||
loop.after_step_hook = display.refresh
|
||||
|
||||
# font styles
|
||||
# import constants from modtrezorui
|
||||
|
||||
SIZE = Display.FONT_SIZE
|
||||
NORMAL = Display.FONT_NORMAL
|
||||
BOLD = Display.FONT_BOLD
|
||||
MONO = Display.FONT_MONO
|
||||
|
||||
# display width and height
|
||||
SCREEN = const(240)
|
||||
SCREEN = Display.WIDTH # used also for height as we have square display
|
||||
|
||||
|
||||
def lerpi(a: int, b: int, t: float) -> int:
|
||||
|
Loading…
Reference in New Issue
Block a user