From 66ece583237bb7af62b1e7d5fd6331b3a6abb27e Mon Sep 17 00:00:00 2001 From: Astra Date: Fri, 13 Oct 2023 01:19:54 +0900 Subject: [PATCH] Fix double arrows and add proper indication --- .../services/gui/modules/byte_input.c | 90 +++++++++++------- .../Common/More_data_placeholder_5x7.png | Bin 0 -> 92 bytes 2 files changed, 54 insertions(+), 36 deletions(-) create mode 100644 assets/icons/Common/More_data_placeholder_5x7.png diff --git a/applications/services/gui/modules/byte_input.c b/applications/services/gui/modules/byte_input.c index e0cbbb779d0..4846bbd8cc9 100644 --- a/applications/services/gui/modules/byte_input.c +++ b/applications/services/gui/modules/byte_input.c @@ -226,16 +226,33 @@ static void byte_input_draw_input(Canvas* canvas, ByteInputModel* model) { canvas_invert_color(canvas); } } else { - canvas_draw_glyph( - canvas, - text_x + 2 + byte_position * 14, - text_y, - byte_input_get_nibble_text(model->bytes[i], true)); - canvas_draw_glyph( - canvas, - text_x + 8 + byte_position * 14, - text_y, - byte_input_get_nibble_text(model->bytes[i], false)); + if(model->first_visible_byte > 0 && i == model->first_visible_byte) { + canvas_draw_icon( + canvas, + text_x + 2 + byte_position * 14, + text_y - 7, + &I_More_data_placeholder_5x7); + } else { + canvas_draw_glyph( + canvas, + text_x + 2 + byte_position * 14, + text_y, + byte_input_get_nibble_text(model->bytes[i], true)); + } + if(model->bytes_count - model->first_visible_byte > max_drawable_bytes && + i == model->first_visible_byte + MIN(model->bytes_count, max_drawable_bytes) - 1) { + canvas_draw_icon( + canvas, + text_x + 8 + byte_position * 14, + text_y - 7, + &I_More_data_placeholder_5x7); + } else { + canvas_draw_glyph( + canvas, + text_x + 8 + byte_position * 14, + text_y, + byte_input_get_nibble_text(model->bytes[i], false)); + } } if(draw_index_line) { @@ -260,14 +277,6 @@ static void byte_input_draw_input(Canvas* canvas, ByteInputModel* model) { snprintf(str, 20, "%u", (model->selected_byte + 1)); canvas_draw_str(canvas, text_x + 75, text_y2, str); } - - if(model->bytes_count - model->first_visible_byte > max_drawable_bytes) { - canvas_draw_icon(canvas, 123, 21, &I_ButtonRightSmall_3x5); - } - - if(model->first_visible_byte > 0) { - canvas_draw_icon(canvas, 1, 21, &I_ButtonLeftSmall_3x5); - } } /** Draw input box (selected view) @@ -306,27 +315,36 @@ static void byte_input_draw_input_selected(Canvas* canvas, ByteInputModel* model byte_input_get_nibble_text(model->bytes[i], false)); canvas_invert_color(canvas); } else { - canvas_draw_glyph( - canvas, - text_x + 2 + byte_position * 14, - text_y, - byte_input_get_nibble_text(model->bytes[i], true)); - canvas_draw_glyph( - canvas, - text_x + 8 + byte_position * 14, - text_y, - byte_input_get_nibble_text(model->bytes[i], false)); + if(model->first_visible_byte > 0 && i == model->first_visible_byte) { + canvas_draw_icon( + canvas, + text_x + 2 + byte_position * 14, + text_y - 7, + &I_More_data_placeholder_5x7); + } else { + canvas_draw_glyph( + canvas, + text_x + 2 + byte_position * 14, + text_y, + byte_input_get_nibble_text(model->bytes[i], true)); + } + if(model->bytes_count - model->first_visible_byte > max_drawable_bytes && + i == model->first_visible_byte + MIN(model->bytes_count, max_drawable_bytes) - 1) { + canvas_draw_icon( + canvas, + text_x + 8 + byte_position * 14, + text_y - 7, + &I_More_data_placeholder_5x7); + } else { + canvas_draw_glyph( + canvas, + text_x + 8 + byte_position * 14, + text_y, + byte_input_get_nibble_text(model->bytes[i], false)); + } } } - if(model->bytes_count - model->first_visible_byte > max_drawable_bytes) { - canvas_draw_icon(canvas, 123, 21, &I_ButtonRightSmall_3x5); - } - - if(model->first_visible_byte > 0) { - canvas_draw_icon(canvas, 1, 21, &I_ButtonLeftSmall_3x5); - } - canvas_invert_color(canvas); } diff --git a/assets/icons/Common/More_data_placeholder_5x7.png b/assets/icons/Common/More_data_placeholder_5x7.png new file mode 100644 index 0000000000000000000000000000000000000000..85025d9f0acc7275b44e8fdc45ea8e2c9293e68e GIT binary patch literal 92 zcmeAS@N?(olHy`uVBq!ia0vp^tU%1p!3-q7SC-!aQfvV}A+G=b{|7Qd4_&SUQi7f? njv*Ddk`fe{44M=i8W