mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-30 17:21:21 +00:00
ui/text: add icon_color
This commit is contained in:
parent
814de4acb4
commit
5ed83f0e18
@ -37,13 +37,13 @@ class Loader(ui.Widget):
|
|||||||
s = self.normal_style
|
s = self.normal_style
|
||||||
if s['icon'] is None:
|
if s['icon'] is None:
|
||||||
ui.display.loader(
|
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:
|
elif s['icon-fg-color'] is None:
|
||||||
ui.display.loader(
|
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:
|
else:
|
||||||
ui.display.loader(
|
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):
|
def __iter__(self):
|
||||||
sleep = loop.sleep(1000000 // 60) # 60 fps
|
sleep = loop.sleep(1000000 // 60) # 60 fps
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
from micropython import const
|
from micropython import const
|
||||||
from trezor import ui
|
from trezor import ui
|
||||||
|
|
||||||
TEXT_HEADER_HEIGHT = const(51)
|
TEXT_HEADER_HEIGHT = const(48)
|
||||||
TEXT_LINE_HEIGHT = const(23)
|
TEXT_LINE_HEIGHT = const(26)
|
||||||
TEXT_MARGIN_LEFT = const(14)
|
TEXT_MARGIN_LEFT = const(14)
|
||||||
|
|
||||||
|
|
||||||
class Text(ui.Widget):
|
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_text = header_text
|
||||||
self.header_icon = header_icon
|
self.header_icon = header_icon
|
||||||
|
self.icon_color = icon_color
|
||||||
self.content = content
|
self.content = content
|
||||||
|
|
||||||
def render(self):
|
def render(self):
|
||||||
@ -19,7 +20,7 @@ class Text(ui.Widget):
|
|||||||
style = ui.NORMAL
|
style = ui.NORMAL
|
||||||
fg = ui.FG
|
fg = ui.FG
|
||||||
bg = ui.BG
|
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:
|
for item in self.content:
|
||||||
if isinstance(item, str):
|
if isinstance(item, str):
|
||||||
|
Loading…
Reference in New Issue
Block a user