mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-19 09:13:11 +00:00
7734fb4018
* 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>
36 lines
692 B
C++
36 lines
692 B
C++
#include "string-element.h"
|
|
#include <gui/elements.h>
|
|
|
|
StringElement::StringElement() {
|
|
}
|
|
|
|
StringElement::~StringElement() {
|
|
}
|
|
|
|
void StringElement::draw(Canvas* canvas) {
|
|
if(text) {
|
|
canvas_set_font(canvas, font);
|
|
elements_multiline_text_aligned(canvas, x, y, horizontal, vertical, text);
|
|
}
|
|
}
|
|
|
|
bool StringElement::input(InputEvent* event) {
|
|
return false;
|
|
}
|
|
|
|
void StringElement::set_text(
|
|
const char* _text,
|
|
uint8_t _x,
|
|
uint8_t _y,
|
|
Align _horizontal,
|
|
Align _vertical,
|
|
Font _font) {
|
|
lock_model();
|
|
text = _text;
|
|
x = _x;
|
|
y = _y;
|
|
horizontal = _horizontal;
|
|
vertical = _vertical;
|
|
font = _font;
|
|
unlock_model(true);
|
|
}
|