mirror of
https://github.com/esphome/esphome.git
synced 2025-11-18 15:55:46 +00:00
[lvgl] Add lvgl.widget.focus action and related triggers. (#7315)
This commit is contained in:
@@ -15,6 +15,60 @@ static void log_cb(const char *buf) {
|
||||
}
|
||||
#endif // LV_USE_LOG
|
||||
|
||||
static const char *const EVENT_NAMES[] = {
|
||||
"NONE",
|
||||
"PRESSED",
|
||||
"PRESSING",
|
||||
"PRESS_LOST",
|
||||
"SHORT_CLICKED",
|
||||
"LONG_PRESSED",
|
||||
"LONG_PRESSED_REPEAT",
|
||||
"CLICKED",
|
||||
"RELEASED",
|
||||
"SCROLL_BEGIN",
|
||||
"SCROLL_END",
|
||||
"SCROLL",
|
||||
"GESTURE",
|
||||
"KEY",
|
||||
"FOCUSED",
|
||||
"DEFOCUSED",
|
||||
"LEAVE",
|
||||
"HIT_TEST",
|
||||
"COVER_CHECK",
|
||||
"REFR_EXT_DRAW_SIZE",
|
||||
"DRAW_MAIN_BEGIN",
|
||||
"DRAW_MAIN",
|
||||
"DRAW_MAIN_END",
|
||||
"DRAW_POST_BEGIN",
|
||||
"DRAW_POST",
|
||||
"DRAW_POST_END",
|
||||
"DRAW_PART_BEGIN",
|
||||
"DRAW_PART_END",
|
||||
"VALUE_CHANGED",
|
||||
"INSERT",
|
||||
"REFRESH",
|
||||
"READY",
|
||||
"CANCEL",
|
||||
"DELETE",
|
||||
"CHILD_CHANGED",
|
||||
"CHILD_CREATED",
|
||||
"CHILD_DELETED",
|
||||
"SCREEN_UNLOAD_START",
|
||||
"SCREEN_LOAD_START",
|
||||
"SCREEN_LOADED",
|
||||
"SCREEN_UNLOADED",
|
||||
"SIZE_CHANGED",
|
||||
"STYLE_CHANGED",
|
||||
"LAYOUT_CHANGED",
|
||||
"GET_SELF_SIZE",
|
||||
};
|
||||
|
||||
std::string lv_event_code_name_for(uint8_t event_code) {
|
||||
if (event_code < sizeof(EVENT_NAMES) / sizeof(EVENT_NAMES[0])) {
|
||||
return EVENT_NAMES[event_code];
|
||||
}
|
||||
return str_sprintf("%2d", event_code);
|
||||
}
|
||||
static void rounder_cb(lv_disp_drv_t *disp_drv, lv_area_t *area) {
|
||||
// make sure all coordinates are even
|
||||
if (area->x1 & 1)
|
||||
|
||||
Reference in New Issue
Block a user