|
ginnOS
The reference: libc, the libraries and the kernel
|
idunn: a one-line text field: a slightly inset well with a placeholder, a blinking caret, selection with the mouse and the keys, the clipboard, and scrolling when the text is longer than the field. More...
Macros | |
| #define | HEIGHT 32 |
| #define | PILL_H 40 |
| #define | PADDING 12 |
| #define | PLAIN_PAD 3 |
| #define | ICON_SIZE 16 |
| #define | ICON_GAP 8 |
| #define | WIDTH 240 |
| #define | BLINK_MS 500 |
| #define | BULLET "\xe2\x80\xa2" |
| #define | BULLET_BYTES 3 |
| #define | SECRET_MAX 128 |
Functions | |
| void | idunn_draw_well (idunn_widget_t *w, gfx_buffer_t *buf) |
| the well of a text input: fill, inset shadow, border and ring (text_field.c) | |
| idunn_widget_t * | idunn_text_field (const char *placeholder) |
| a one-line text field, 32 pixels high. | |
| const char * | idunn_text_field_text (const idunn_widget_t *field) |
| the text (UTF-8); valid until the text changes | |
| void | idunn_text_field_set_text (idunn_widget_t *field, const char *text) |
| void | idunn_text_field_set_icon (idunn_widget_t *field, const char *icon) |
| an icon (a Lucide name) at the start, as in a search field | |
| void | idunn_text_field_set_plain (idunn_widget_t *field, bool plain) |
| select bytes start to end (the caret at end); typing replaces them. | |
| void | idunn_text_field_set_pill (idunn_widget_t *field, bool pill) |
| a pill: round ends, see-through (over a picture, as on a login screen), no border, the text in the middle while it fits. | |
| void | idunn_text_field_set_secret (idunn_widget_t *field, bool secret) |
| a password field: a bullet for each character, and no Copy or Cut | |
| int32_t | idunn_text_field_text_width (idunn_widget_t *field) |
| the width of the field's text in pixels (0 before it is in a window) | |
| void | idunn_text_field_on_change (idunn_widget_t *field, idunn_callback_t on_change, void *data) |
| on_change after every change of the text; on_submit on Enter | |
| void | idunn_text_field_on_blur (idunn_widget_t *field, idunn_callback_t on_blur, void *data) |
| on_blur when the field loses the keyboard | |
| void | idunn_text_field_on_submit (idunn_widget_t *field, idunn_callback_t on_submit, void *data) |
| void | idunn_text_field_select (idunn_widget_t *field, size_t start, size_t end) |
idunn: a one-line text field: a slightly inset well with a placeholder, a blinking caret, selection with the mouse and the keys, the clipboard, and scrolling when the text is longer than the field.
| #define HEIGHT 32 |
| #define PILL_H 40 |
| #define PADDING 12 |
| #define PLAIN_PAD 3 |
| #define ICON_SIZE 16 |
| #define ICON_GAP 8 |
| #define WIDTH 240 |
| #define BLINK_MS 500 |
| #define BULLET "\xe2\x80\xa2" |
| #define BULLET_BYTES 3 |
| #define SECRET_MAX 128 |
| void idunn_draw_well | ( | idunn_widget_t * | w, |
| gfx_buffer_t * | buf ) |
the well of a text input: fill, inset shadow, border and ring (text_field.c)
| idunn_widget_t * idunn_text_field | ( | const char * | placeholder | ) |
a one-line text field, 32 pixels high.
| placeholder | the muted text it shows when it is empty, or NULL. |
| const char * idunn_text_field_text | ( | const idunn_widget_t * | field | ) |
the text (UTF-8); valid until the text changes
| void idunn_text_field_set_text | ( | idunn_widget_t * | field, |
| const char * | text ) |
| void idunn_text_field_set_icon | ( | idunn_widget_t * | field, |
| const char * | icon ) |
an icon (a Lucide name) at the start, as in a search field
| void idunn_text_field_set_plain | ( | idunn_widget_t * | field, |
| bool | plain ) |
select bytes start to end (the caret at end); typing replaces them.
(size_t)-1 is the end of the text. a plain field: a thin box around the text, with little padding and no ring (a name that is changed in place, as in a file list).
| void idunn_text_field_set_pill | ( | idunn_widget_t * | field, |
| bool | pill ) |
a pill: round ends, see-through (over a picture, as on a login screen), no border, the text in the middle while it fits.
| void idunn_text_field_set_secret | ( | idunn_widget_t * | field, |
| bool | secret ) |
a password field: a bullet for each character, and no Copy or Cut
| int32_t idunn_text_field_text_width | ( | idunn_widget_t * | field | ) |
the width of the field's text in pixels (0 before it is in a window)
| void idunn_text_field_on_change | ( | idunn_widget_t * | field, |
| idunn_callback_t | on_change, | ||
| void * | data ) |
on_change after every change of the text; on_submit on Enter
| void idunn_text_field_on_blur | ( | idunn_widget_t * | field, |
| idunn_callback_t | on_blur, | ||
| void * | data ) |
on_blur when the field loses the keyboard
| void idunn_text_field_on_submit | ( | idunn_widget_t * | field, |
| idunn_callback_t | on_submit, | ||
| void * | data ) |
| void idunn_text_field_select | ( | idunn_widget_t * | field, |
| size_t | start, | ||
| size_t | end ) |