1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-18 05:28:40 +00:00

ui/text: add icon_color

This commit is contained in:
Jan Pochyla 2018-01-11 19:46:40 +01:00
parent 814de4acb4
commit 5ed83f0e18
2 changed files with 8 additions and 7 deletions

View File

@ -37,13 +37,13 @@ class Loader(ui.Widget):
s = self.normal_style
if s['icon'] is None:
ui.display.loader(
progress, -8, s['fg-color'], s['bg-color'])
progress, -24, s['fg-color'], s['bg-color'])
elif s['icon-fg-color'] is None:
ui.display.loader(
progress, -8, s['fg-color'], s['bg-color'], res.load(s['icon']))
progress, -24, s['fg-color'], s['bg-color'], res.load(s['icon']))
else:
ui.display.loader(
progress, -8, s['fg-color'], s['bg-color'], res.load(s['icon']), s['icon-fg-color'])
progress, -24, s['fg-color'], s['bg-color'], res.load(s['icon']), s['icon-fg-color'])
def __iter__(self):
sleep = loop.sleep(1000000 // 60) # 60 fps

View File

@ -1,16 +1,17 @@
from micropython import const
from trezor import ui
TEXT_HEADER_HEIGHT = const(51)
TEXT_LINE_HEIGHT = const(23)
TEXT_HEADER_HEIGHT = const(48)
TEXT_LINE_HEIGHT = const(26)
TEXT_MARGIN_LEFT = const(14)
class Text(ui.Widget):
def __init__(self, header_text, header_icon, *content):
def __init__(self, header_text, header_icon, *content, icon_color=ui.ORANGE_ICON):
self.header_text = header_text
self.header_icon = header_icon
self.icon_color = icon_color
self.content = content
def render(self):
@ -19,7 +20,7 @@ class Text(ui.Widget):
style = ui.NORMAL
fg = ui.FG
bg = ui.BG
ui.header(self.header_text, self.header_icon, ui.TITLE_GREY, ui.BG, ui.ORANGE_ICON)
ui.header(self.header_text, self.header_icon, ui.TITLE_GREY, ui.BG, self.icon_color)
for item in self.content:
if isinstance(item, str):