[FL-1371][FL-1502] Lfrfid app: fixes. (#555)
* Gui module byte-input: changed api * Gui: changed font height in multiline text according to guideline * Apps lrfid, nfc: changed send and receive icon * App lfrfid: fix text, fix scene switсh * Elements: multiline text framed, fix paddings * Gui: remove duplicate definition of elements_multiline_text_framed * App NFC: update byte_input callback signature * App subghz: fix text lines in capture scene * App subghz: position of the text is aligned with the guidelines and other scenes * App subghz: removed mockup Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -81,7 +81,13 @@ uint8_t canvas_height(Canvas* canvas) {
|
||||
|
||||
uint8_t canvas_current_font_height(Canvas* canvas) {
|
||||
furi_assert(canvas);
|
||||
return u8g2_GetMaxCharHeight(&canvas->fb);
|
||||
uint8_t font_height = u8g2_GetMaxCharHeight(&canvas->fb);
|
||||
|
||||
if(canvas->fb.font == u8g2_font_haxrcorp4089_tr) {
|
||||
font_height += 1;
|
||||
}
|
||||
|
||||
return font_height;
|
||||
}
|
||||
|
||||
void canvas_clear(Canvas* canvas) {
|
||||
|
@@ -196,7 +196,7 @@ void elements_multiline_text_aligned(
|
||||
furi_assert(canvas);
|
||||
furi_assert(text);
|
||||
|
||||
uint8_t font_height = canvas_current_font_height(canvas) + 2;
|
||||
uint8_t font_height = canvas_current_font_height(canvas);
|
||||
string_t str;
|
||||
string_init(str);
|
||||
const char* start = text;
|
||||
@@ -298,10 +298,10 @@ void elements_multiline_text_framed(Canvas* canvas, uint8_t x, uint8_t y, const
|
||||
}
|
||||
|
||||
canvas_set_color(canvas, ColorWhite);
|
||||
canvas_draw_box(canvas, x, y - font_y, str_width + 8, font_y * lines + 6);
|
||||
canvas_draw_box(canvas, x, y - font_y, str_width + 8, font_y * lines + 4);
|
||||
canvas_set_color(canvas, ColorBlack);
|
||||
elements_multiline_text(canvas, x + 4, y + 1, text);
|
||||
elements_frame(canvas, x, y - font_y, str_width + 8, font_y * lines + 6);
|
||||
elements_multiline_text(canvas, x + 4, y - 1, text);
|
||||
elements_frame(canvas, x, y - font_y, str_width + 8, font_y * lines + 4);
|
||||
}
|
||||
|
||||
void elements_slightly_rounded_frame(
|
||||
|
@@ -101,14 +101,6 @@ void elements_multiline_text(Canvas* canvas, uint8_t x, uint8_t y, const char* t
|
||||
*/
|
||||
void elements_multiline_text_framed(Canvas* canvas, uint8_t x, uint8_t y, const char* text);
|
||||
|
||||
/*
|
||||
* Draw framed multiline text
|
||||
* @param x, y - top left corner coordinates
|
||||
* @param text - string (possible multiline)
|
||||
*/
|
||||
|
||||
void elements_multiline_text_framed(Canvas* canvas, uint8_t x, uint8_t y, const char* text);
|
||||
|
||||
/*
|
||||
* Draw slightly rounded frame
|
||||
* @param x, y - top left corner coordinates
|
||||
|
@@ -397,7 +397,7 @@ static void byte_input_dec_selected_byte(ByteInputModel* model) {
|
||||
*/
|
||||
static void byte_input_call_input_callback(ByteInputModel* model) {
|
||||
if(model->input_callback != NULL) {
|
||||
model->input_callback(model->callback_context, model->bytes, model->bytes_count);
|
||||
model->input_callback(model->callback_context);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -408,7 +408,7 @@ static void byte_input_call_input_callback(ByteInputModel* model) {
|
||||
*/
|
||||
static void byte_input_call_changed_callback(ByteInputModel* model) {
|
||||
if(model->changed_callback != NULL) {
|
||||
model->changed_callback(model->callback_context, model->bytes, model->bytes_count);
|
||||
model->changed_callback(model->callback_context);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -15,13 +15,13 @@ typedef struct ByteInput ByteInput;
|
||||
* @brief callback that is executed on save button press
|
||||
*
|
||||
*/
|
||||
typedef void (*ByteInputCallback)(void* context, uint8_t* bytes, uint8_t bytes_count);
|
||||
typedef void (*ByteInputCallback)(void* context);
|
||||
|
||||
/**
|
||||
* @brief callback that is executed when byte buffer is changed
|
||||
*
|
||||
*/
|
||||
typedef void (*ByteChangedCallback)(void* context, uint8_t* bytes, uint8_t bytes_count);
|
||||
typedef void (*ByteChangedCallback)(void* context);
|
||||
|
||||
/**
|
||||
* @brief Allocate and initialize byte input. This byte input is used to enter bytes.
|
||||
|
Reference in New Issue
Block a user