Ken Van Hoeylandt 41ad569154
UI/UX improvements for small screen devices (#340)
- Improved UI/UX of various WiFi apps to make it compatible with Cardputer.
- Improved UI/UX of Serial Console to make it compatible with Cardputer.
- Boot app now shows a smaller logo on Cardputer
- CrashDiagnostics app: Use different text if no touch screen is present
2025-09-20 00:19:29 +02:00

33 lines
954 B
C++

#ifdef ESP_PLATFORM
#include <Tactility/Tactility.h>
#include <lvgl.h>
extern "C" {
extern void __real_lv_obj_set_flex_flow(lv_obj_t* obj, lv_flex_flow_t flow);
extern lv_obj_t* __real_lv_obj_create(lv_obj_t* parent);
void __wrap_lv_obj_set_flex_flow(lv_obj_t* obj, lv_flex_flow_t flow) {
__real_lv_obj_set_flex_flow(obj, flow);
if (tt::hal::getConfiguration()->uiScale == tt::hal::UiScale::Smallest) {
lv_obj_set_style_pad_gap(obj, 4, LV_STATE_DEFAULT);
}
}
lv_obj_t* __wrap_lv_obj_create(lv_obj_t* parent) {
auto obj = __real_lv_obj_create(parent);
if (tt::hal::getConfiguration()->uiScale == tt::hal::UiScale::Smallest) {
lv_obj_set_style_pad_all(obj, 2, LV_STATE_DEFAULT);
lv_obj_set_style_pad_gap(obj, 2, LV_STATE_DEFAULT);
lv_obj_set_style_radius(obj, 3, LV_STATE_DEFAULT);
lv_obj_set_style_border_width(obj, 1, LV_STATE_DEFAULT);
}
return obj;
}
}
#endif // ESP_PLATFORM