feat(btnmatrix/keyboard): add option to show popovers on button press (#2537)
This adds a new option that, when enabled, shows popovers when pressing buttons, similar to how the system keyboards on Android and iOS behave.
This commit is contained in:
@@ -49,6 +49,7 @@ typedef struct {
|
||||
lv_btnmatrix_t btnm;
|
||||
lv_obj_t * ta; /*Pointer to the assigned text area*/
|
||||
lv_keyboard_mode_t mode; /*Key map type*/
|
||||
uint8_t popovers : 1; /*Show button titles in popovers on press*/
|
||||
} lv_keyboard_t;
|
||||
|
||||
extern const lv_obj_class_t lv_keyboard_class;
|
||||
@@ -82,6 +83,13 @@ void lv_keyboard_set_textarea(lv_obj_t * kb, lv_obj_t * ta);
|
||||
*/
|
||||
void lv_keyboard_set_mode(lv_obj_t * kb, lv_keyboard_mode_t mode);
|
||||
|
||||
/**
|
||||
* Show the button title in a popover when pressed.
|
||||
* @param kb pointer to a Keyboard object
|
||||
* @param en whether "popovers" mode is enabled
|
||||
*/
|
||||
void lv_keyboard_set_popovers(lv_obj_t * kb, bool en);
|
||||
|
||||
/**
|
||||
* Set a new map for the keyboard
|
||||
* @param kb pointer to a Keyboard object
|
||||
@@ -110,6 +118,13 @@ lv_obj_t * lv_keyboard_get_textarea(const lv_obj_t * kb);
|
||||
*/
|
||||
lv_keyboard_mode_t lv_keyboard_get_mode(const lv_obj_t * kb);
|
||||
|
||||
/**
|
||||
* Tell whether "popovers" mode is enabled or not.
|
||||
* @param kb pointer to a Keyboard object
|
||||
* @return true: "popovers" mode is enabled; false: disabled
|
||||
*/
|
||||
bool lv_btnmatrix_get_popovers(const lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get the current map of a keyboard
|
||||
* @param kb pointer to a keyboard object
|
||||
|
||||
Reference in New Issue
Block a user