Files
tactility/Tactility/Source/lvgl/wrappers/textarea.cpp
T
Ken Van Hoeylandt e6e1dcd0ca Software keyboard refactored (#594)
Removed software keyboard in Tactility subproject (GuiService, Lvgl.cpp) and re-implemented it in TactilityKernel.
2026-07-28 00:04:09 +02:00

32 lines
890 B
C++

#ifdef ESP_PLATFORM
#include <lvgl/lvgl.h>
#include <lvgl/devices/keyboard.h>
extern "C" {
extern lv_obj_t* __real_lv_textarea_create(lv_obj_t* parent);
lv_obj_t* __wrap_lv_textarea_create(lv_obj_t* parent) {
auto textarea = __real_lv_textarea_create(parent);
if (lvgl_get_ui_density() == LVGL_UI_DENSITY_COMPACT) {
lv_obj_set_style_pad_all(textarea, 2, LV_STATE_DEFAULT);
}
auto* software_keyboard = lvgl_software_keyboard_get_last();
if (software_keyboard != nullptr) {
lvgl_keyboard_add_textarea(software_keyboard, textarea);
}
if (lv_display_get_color_format(lv_obj_get_display(parent)) == LV_COLOR_FORMAT_L8) {
lv_obj_set_style_border_width(textarea, 1, LV_PART_MAIN);
lv_obj_set_style_border_color(textarea, lv_theme_get_color_secondary(parent), LV_PART_MAIN);
}
return textarea;
}
}
#endif // ESP_PLATFORM