Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 27 additions & 26 deletions ports/stm32/boards/Passport/images/color/ICON_CASA.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: © 2022 Foundation Devices, Inc. <[email protected]>
// SPDX-FileCopyrightText: © 2024 Foundation Devices, Inc. <[email protected]>
// SPDX-License-Identifier: GPL-3.0-or-later
//

Expand All @@ -14,32 +14,33 @@
#ifndef LV_ATTRIBUTE_IMG_ICON_CASA
#define LV_ATTRIBUTE_IMG_ICON_CASA
#endif

const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_ICON_CASA uint8_t ICON_CASA_map[] = {
0x00, 0x00, 0x00, 0x00, /*Color of index 0*/
0xfe, 0xfe, 0xfe, 0x36, /*Color of index 1*/
0xfe, 0xfe, 0xfe, 0xbe, /*Color of index 2*/
0xfe, 0xfe, 0xfe, 0xfd, /*Color of index 3*/
0x00, 0x00, 0x00, 0x02, /*Color of index 0*/
0x00, 0x00, 0x00, 0x54, /*Color of index 1*/
0x00, 0x00, 0x00, 0xa0, /*Color of index 2*/
0x00, 0x00, 0x00, 0xf2, /*Color of index 3*/

0xbf, 0xff, 0xff, 0xff, 0xfe,
0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xeb, 0xff,
0xff, 0xff, 0xf9, 0x41, 0x6f,
0xff, 0xff, 0xd0, 0x00, 0x07,
0xff, 0xff, 0x41, 0x69, 0x41,
0xff, 0xfe, 0x06, 0xff, 0x90,
0xff, 0xfd, 0x1b, 0xff, 0xe5,
0xff, 0xf9, 0x1f, 0xff, 0xff,
0xff, 0xfc, 0x1f, 0xff, 0xff,
0xff, 0xf8, 0x1f, 0xff, 0xff,
0xff, 0xfd, 0x1f, 0xff, 0xff,
0xff, 0xfd, 0x1b, 0xff, 0xe5,
0xff, 0xfe, 0x06, 0xff, 0x90,
0xff, 0xff, 0x41, 0x69, 0x41,
0xff, 0xff, 0xd0, 0x00, 0x07,
0xff, 0xff, 0xf9, 0x41, 0x6f,
0xff, 0xff, 0xff, 0xaa, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff,
0xbf, 0xff, 0xff, 0xff, 0xfe,
0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x38, 0x00, 0x00,
0x00, 0x01, 0xff, 0x40, 0x00,
0x00, 0x0f, 0xd7, 0xe0, 0x00,
0x00, 0x7f, 0x00, 0xfd, 0x00,
0x02, 0xf4, 0x00, 0x1f, 0x80,
0x0b, 0xd0, 0xbe, 0x03, 0xe0,
0x3f, 0x03, 0xff, 0xd0, 0xfc,
0x2c, 0x0f, 0x41, 0xf8, 0x28,
0x2d, 0x1e, 0x00, 0x3e, 0x04,
0x1e, 0x1d, 0x00, 0x0b, 0xc0,
0x0f, 0x1e, 0x00, 0x42, 0xf0,
0x0b, 0x4f, 0x41, 0xe1, 0xe0,
0x07, 0x83, 0xff, 0xd2, 0xd0,
0x03, 0xc0, 0xae, 0x03, 0xc0,
0x02, 0xd0, 0x00, 0x07, 0x80,
0x01, 0xe9, 0x55, 0x5b, 0x40,
0x00, 0xff, 0xff, 0xff, 0x00,
0x00, 0x15, 0x55, 0x54, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00,
};

const lv_img_dsc_t ICON_CASA = {
Expand All @@ -48,6 +49,6 @@ const lv_img_dsc_t ICON_CASA = {
.header.reserved = 0,
.header.w = 20,
.header.h = 20,
.data_size = 117,
.data_size = 116,
.data = ICON_CASA_map,
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion ports/stm32/boards/Passport/images/color/ICON_HOURGLASS.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#ifndef LV_ATTRIBUTE_IMG_ICON_HOURGLASS
#define LV_ATTRIBUTE_IMG_ICON_HOURGLASS
#endif

const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_ICON_HOURGLASS uint8_t ICON_HOURGLASS_map[] = {
0x00, 0x00, 0x00, 0x00, /*Color of index 0*/
0xfe, 0xfe, 0xfe, 0xff, /*Color of index 1*/
Expand Down
50 changes: 24 additions & 26 deletions ports/stm32/boards/Passport/images/mono/ICON_CASA.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: © 2022 Foundation Devices, Inc. <[email protected]>
// SPDX-FileCopyrightText: © 2024 Foundation Devices, Inc. <[email protected]>
// SPDX-License-Identifier: GPL-3.0-or-later
//

Expand All @@ -16,38 +16,36 @@
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_ICON_CASA uint8_t ICON_CASA_map[] = {
0x00, 0x00, 0x00, 0x00, /*Color of index 0*/
0xff, 0xff, 0xff, 0xff, /*Color of index 1*/
0x00, 0x00, 0x00, 0x00, /*Color of index 2*/
0x00, 0x00, 0x00, 0x00, /*Color of index 3*/
0x00, 0x00, 0x00, 0xdb, /*Color of index 1*/

0x00, 0x00, 0x00, 0x00, 0x00,
0x15, 0x55, 0x55, 0x55, 0x54,
0x15, 0x55, 0x55, 0x55, 0x54,
0x15, 0x55, 0x55, 0x55, 0x54,
0x15, 0x55, 0x54, 0x00, 0x14,
0x15, 0x55, 0x50, 0x00, 0x04,
0x15, 0x55, 0x40, 0x55, 0x00,
0x15, 0x55, 0x01, 0x55, 0x40,
0x15, 0x55, 0x05, 0x55, 0x54,
0x15, 0x55, 0x05, 0x55, 0x54,
0x15, 0x55, 0x05, 0x55, 0x54,
0x15, 0x55, 0x05, 0x55, 0x54,
0x15, 0x55, 0x01, 0x55, 0x40,
0x15, 0x55, 0x40, 0x55, 0x00,
0x15, 0x55, 0x50, 0x00, 0x04,
0x15, 0x55, 0x54, 0x00, 0x14,
0x15, 0x55, 0x55, 0x55, 0x54,
0x15, 0x55, 0x55, 0x55, 0x54,
0x15, 0x55, 0x55, 0x55, 0x54,
0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00,
0x00, 0x60, 0x00,
0x00, 0xf0, 0x00,
0x03, 0xdc, 0x00,
0x07, 0x0e, 0x00,
0x0e, 0x07, 0x80,
0x38, 0xf1, 0xc0,
0x71, 0xfc, 0xe0,
0x63, 0x8e, 0x60,
0x63, 0x07, 0x00,
0x36, 0x03, 0x80,
0x33, 0x00, 0xc0,
0x33, 0x1d, 0xc0,
0x19, 0xf8, 0x80,
0x18, 0xf1, 0x80,
0x18, 0x01, 0x80,
0x0e, 0xab, 0x00,
0x0f, 0xff, 0x00,
0x01, 0x54, 0x00,
0x00, 0x00, 0x00,
};

const lv_img_dsc_t ICON_CASA = {
.header.cf = LV_IMG_CF_INDEXED_2BIT,
.header.cf = LV_IMG_CF_INDEXED_1BIT,
.header.always_zero = 0,
.header.reserved = 0,
.header.w = 20,
.header.h = 20,
.data_size = 117,
.data_size = 68,
.data = ICON_CASA_map,
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
4 changes: 4 additions & 0 deletions ports/stm32/boards/Passport/modules/views/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ def update(self):
self.icon_view = Image(icon, color=self.header_fg_color)
with Stylize(self.icon_view) as default:
default.align(lv.ALIGN.LEFT_MID)
if self.icon == 'ICON_CASA' and passport.IS_COLOR:
default.pad(top=1)
self.header.add_child(self.icon_view)

header_title = Label(text=self.title, color=self.header_fg_color, long_mode=lv.label.LONG.SCROLL_CIRCULAR)
Expand All @@ -220,6 +222,8 @@ def update(self):
self.right_icon_view = Image(right_icon, color=self.header_fg_color)
with Stylize(self.right_icon_view) as default:
default.align(lv.ALIGN.RIGHT_MID)
if self.right_icon == 'ICON_CASA' and passport.IS_COLOR:
default.pad(top=1)
self.header.add_child(self.right_icon_view)

# Only draw right text if there is no right icon
Expand Down
5 changes: 4 additions & 1 deletion ports/stm32/boards/Passport/modules/views/icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,22 @@


class Icon(View):
def __init__(self, icon, color=None, opa=None):
def __init__(self, icon, color=None, opa=None, bottom_pad=0, top_pad=0):
from utils import derive_icon

super().__init__()
self.icon = derive_icon(icon)
self.color = color
self.opa = opa
self.bottom_pad = bottom_pad
self.top_pad = top_pad

with Stylize(self) as default:
if self.color is not None:
default.img_recolor(self.color)
if self.opa is not None:
default.opa(self.opa)
default.pad(bottom=self.bottom_pad, top=self.top_pad)

def set_icon(self, icon):
from utils import derive_icon
Expand Down
5 changes: 4 additions & 1 deletion ports/stm32/boards/Passport/modules/views/menu_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from constants import MENU_ITEM_CORNER_RADIUS
from views import View
from utils import derive_icon
import passport


class MenuItem(View):
Expand All @@ -19,6 +20,7 @@ def __init__(self, icon='', label='', is_toggle=False, value=False, desc=None, c
from views import Switch

super().__init__(flex_flow=lv.FLEX_FLOW.ROW)
self.icon_name = icon
self.icon = derive_icon(icon)
self.label = label
self.is_toggle = is_toggle
Expand Down Expand Up @@ -50,7 +52,8 @@ def __init__(self, icon='', label='', is_toggle=False, value=False, desc=None, c
focus.img_recolor(FOCUSED_LIST_ITEM_TEXT)

# Icon
self.icon_view = Icon(icon=self.icon)
bottom_pad = 1 if self.icon_name == 'ICON_CASA' and passport.IS_COLOR else 0
self.icon_view = Icon(icon=self.icon, bottom_pad=bottom_pad)
self.icon_view.set_size(21, lv.SIZE.CONTENT)
self.add_child(self.icon_view)

Expand Down
Loading