Skip to content

Commit

Permalink
transparent splash logo & fix tab widget color glitch (#2256)
Browse files Browse the repository at this point in the history
  • Loading branch information
zxkmm authored Sep 22, 2024
1 parent 9390317 commit 42233e6
Show file tree
Hide file tree
Showing 10 changed files with 327 additions and 319 deletions.
632 changes: 319 additions & 313 deletions firmware/application/bitmaps/bmp_splash.hpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion firmware/application/ui/ui_tabview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void Tab::paint(Painter& painter) {
painter.fill_rectangle({rect.left(), rect.top(), rect.width() - 8, rect.height()}, color);

if (!highlighted())
painter.draw_hline({rect.left(), rect.top()}, rect.width() - 9, Theme::getInstance()->fg_light->foreground);
painter.draw_hline({rect.left(), rect.top()}, rect.width() - 9, Theme::getInstance()->bg_light->background);

painter.draw_bitmap(
{rect.right() - 8, rect.top()},
Expand Down
2 changes: 1 addition & 1 deletion firmware/application/ui_navigation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ BMPView::BMPView(NavigationView& nav) {

void BMPView::paint(Painter&) {
if (!portapack::display.drawBMP2({0, 0}, splash_dot_bmp))
portapack::display.drawBMP({(240 - 230) / 2, (320 - 50) / 2 - 10}, splash_bmp, false);
portapack::display.drawBMP({(240 - 230) / 2, (320 - 50) / 2 - 10}, splash_bmp, true);
}

/* NotImplementedView ****************************************************/
Expand Down
8 changes: 4 additions & 4 deletions firmware/common/lcd_ili9341.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,12 @@ void ILI9341::drawBMP(const ui::Point p, const uint8_t* bitmap, const bool trans
data_idx = bmp_header->image_data;
const bmp_palette_t* bmp_palette = (const bmp_palette_t*)&bitmap[bmp_header->BIH_size + 14];

// Convert palette and find pure magenta index (alpha color key)
// Convert palette and find pure magenta index (alpha color key) rgb dec(41,24,22)
for (c = 0; c < 16; c++) {
palette[c] = ui::Color(bmp_palette->color[c].R, bmp_palette->color[c].G, bmp_palette->color[c].B);
if ((bmp_palette->color[c].R == 0xFF) &&
(bmp_palette->color[c].G == 0x00) &&
(bmp_palette->color[c].B == 0xFF)) transp_idx = c;
if ((bmp_palette->color[c].R == 0x29) &&
(bmp_palette->color[c].G == 0x18) &&
(bmp_palette->color[c].B == 0x16)) transp_idx = c;
}

if (!transparency) {
Expand Down
1 change: 1 addition & 0 deletions firmware/tools/bitmap_tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bitmap is for icons, it's colorless and headless; splash and modal isn't using bitmap
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions firmware/tools/bmp_tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bmp is for splash and modal warning, it contains color info and file header; icons isn't using bmp.
File renamed without changes.
File renamed without changes.

0 comments on commit 42233e6

Please sign in to comment.