mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-14 12:48:12 +00:00
move default splash into sdcard (#2595)
* move bmps to sdcard * remove unrelated files * gitignore * credit * format
This commit is contained in:

committed by
GitHub

parent
8a7aa9c0f8
commit
37cc35d3c6
@@ -67,6 +67,7 @@ void DebugFontsView::paint(Painter& painter) {
|
||||
|
||||
line_pos = display_font(painter, 32, Theme::getInstance()->bg_darkest, "Fixed 8x16", true);
|
||||
display_font(painter, line_pos + 16, Theme::getInstance()->bg_darkest_small, "Fixed 5x8", false);
|
||||
paint_zoomed_text(painter);
|
||||
}
|
||||
|
||||
void DebugFontsView::update_address_text() {
|
||||
@@ -74,16 +75,29 @@ void DebugFontsView::update_address_text() {
|
||||
text_address.set("0x" + to_string_hex(ascii_value, 2));
|
||||
}
|
||||
|
||||
void DebugFontsView::paint_zoomed_text(Painter& painter) {
|
||||
if (field_zoom_level.value() == 0) return;
|
||||
uint8_t cursor_pos = field_cursor.value();
|
||||
painter.draw_char({screen_width / 2, screen_height / 2},
|
||||
*Theme::getInstance()->bg_darkest,
|
||||
(char)(cursor_pos + 0x20), field_zoom_level.value());
|
||||
}
|
||||
|
||||
DebugFontsView::DebugFontsView(NavigationView& nav)
|
||||
: nav_{nav} {
|
||||
add_children({&field_cursor,
|
||||
&text_address});
|
||||
&text_address,
|
||||
&field_zoom_level});
|
||||
set_focusable(true);
|
||||
|
||||
field_cursor.on_change = [&](int32_t) {
|
||||
update_address_text();
|
||||
set_dirty();
|
||||
};
|
||||
|
||||
field_zoom_level.on_change = [&](int32_t) {
|
||||
set_dirty();
|
||||
};
|
||||
}
|
||||
|
||||
void DebugFontsView::focus() {
|
||||
|
@@ -46,10 +46,17 @@ class DebugFontsView : public View {
|
||||
private:
|
||||
uint16_t display_font(Painter& painter, uint16_t y_offset, const Style* font_style, std::string_view font_name, bool is_big_font);
|
||||
void update_address_text();
|
||||
void paint_zoomed_text(Painter& painter);
|
||||
|
||||
NumberField field_cursor{
|
||||
{0 * 8, 0 * 8},
|
||||
4,
|
||||
{0, 1000},
|
||||
1,
|
||||
' '};
|
||||
NumberField field_zoom_level{
|
||||
{6 * 8, 0 * 8},
|
||||
4,
|
||||
{0, 1000},
|
||||
1,
|
||||
' '};
|
||||
|
Reference in New Issue
Block a user