gui: render icons according to their icon type
What changed, and why it matters
This commit changes how small on-screen icons are drawn on the Blockstream Jade hardware wallet. It adds a special case for QR-code-style icons so they use a dedicated QR background color instead of the icon's own background color. There is no indication this fixes a security bug; it appears to be a user-interface polish or correctness change.
No security action required. Treat as a normal UI fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In main/gui.c, render_icon() now branches on node->icon->icon_type. For ICON_PLAIN it keeps the previous behavior (color and bg_color from the icon struct). For ICON_QR it uses gui_get_qrcode_color() as the background. The transparent-background check now compares bg_color against color rather than the icon’s stored bg_color against color. The change is localized to GUI rendering and does not touch cryptography, memory allocation, input parsing, or trust boundaries.
Changed components
main/gui.crender_icon()icon/QR display renderingInspect captured patch +13 / −3
diff --git a/main/gui.c b/main/gui.c
index 67a4938..444cf8c 100644
--- a/main/gui.c
+++ b/main/gui.c
@@ -2005,10 +2005,20 @@ static void render_icon(gui_view_node_t* node, const dispWin_t cs, const uint8_t
JADE_ASSERT(node->kind == ICON);
if (node->icon) {
- const color_t color = node->is_selected ? node->icon->selected_color : node->icon->color;
- const bool transparent = node->icon->bg_color == node->icon->color;
+ color_t color, bg_color;
+ if (node->icon->icon_type == ICON_PLAIN) {
+ color = node->is_selected ? node->icon->selected_color : node->icon->color;
+ bg_color = node->icon->bg_color;
+ } else if (node->icon->icon_type == ICON_QR) {
+ color = node->is_selected ? node->icon->selected_color : node->icon->color;
+ bg_color = gui_get_qrcode_color();
+ } else {
+ JADE_ASSERT(false); // Unknown fill type
+ }
+
+ const bool transparent = bg_color == color;
display_icon(&node->icon->icon, resolve_halign(0, node->icon->halign), resolve_valign(0, node->icon->valign),
- color, cs, transparent ? NULL : &node->icon->bg_color);
+ color, cs, transparent ? NULL : &bg_color);
}
// Draw any children directly over the current node
Why this scored 13/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.