[FL-1497] GUI textbox element and widget (#792)
* canvas: add font parameters * elements: add text box element * widget: add text box element * nfc: rework delete and info scene with text box widget * gui: update documentation * gui: fix canvas_get_font_params return Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -20,7 +20,15 @@ typedef enum {
|
||||
} Color;
|
||||
|
||||
/** Fonts enumeration */
|
||||
typedef enum { FontPrimary, FontSecondary, FontKeyboard, FontBigNumbers } Font;
|
||||
typedef enum {
|
||||
FontPrimary,
|
||||
FontSecondary,
|
||||
FontKeyboard,
|
||||
FontBigNumbers,
|
||||
|
||||
// Keep last for fonts number calculation
|
||||
FontTotalNumber,
|
||||
} Font;
|
||||
|
||||
/** Alignment enumeration */
|
||||
typedef enum {
|
||||
@@ -45,6 +53,14 @@ typedef enum {
|
||||
CanvasFontDirectionDownToTop,
|
||||
} CanvasFontDirection;
|
||||
|
||||
/** Font parameters */
|
||||
typedef struct {
|
||||
uint8_t leading_default;
|
||||
uint8_t leading_min;
|
||||
uint8_t height;
|
||||
uint8_t descender;
|
||||
} CanvasFontParameters;
|
||||
|
||||
/** Canvas anonymouse structure */
|
||||
typedef struct Canvas Canvas;
|
||||
|
||||
@@ -72,6 +88,15 @@ uint8_t canvas_height(Canvas* canvas);
|
||||
*/
|
||||
uint8_t canvas_current_font_height(Canvas* canvas);
|
||||
|
||||
/** Get font parameters
|
||||
*
|
||||
* @param canvas Canvas instance
|
||||
* @param font Font
|
||||
*
|
||||
* @return pointer to CanvasFontParameters structure
|
||||
*/
|
||||
CanvasFontParameters* canvas_get_font_params(Canvas* canvas, Font font);
|
||||
|
||||
/** Clear canvas
|
||||
*
|
||||
* @param canvas Canvas instance
|
||||
|
Reference in New Issue
Block a user