fix(Widgets): Optimise widget event callbacks to remove unnecessary calls to the event handler. (#7954)

This commit is contained in:
Pete Bone
2025-03-25 12:08:31 +00:00
committed by GitHub
parent 60d976c466
commit b7061642a0
4 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -25,7 +25,7 @@
#error "LV_FS_UEFI_LETTER must be an upper case ASCII letter"
#else /*Lean rules for backward compatibility*/
#warning LV_FS_UEFI_LETTER should be an upper case ASCII letter. \
Using a slash symbol as driver-identifier letter should be replaced with LV_FS_DEFAULT_DRIVE_LETTER mechanism.
Using a slash symbol as driver - identifier letter should be replaced with LV_FS_DEFAULT_DRIVE_LETTER mechanism.
#endif
#endif
#endif
+2 -1
View File
@@ -277,7 +277,8 @@ static void lv_tabview_constructor(const lv_obj_class_t * class_p, lv_obj_t * ob
cont = lv_obj_create(obj);
lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_ROW);
lv_obj_add_event_cb(cont, cont_scroll_end_event_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(cont, cont_scroll_end_event_cb, LV_EVENT_LAYOUT_CHANGED, NULL);
lv_obj_add_event_cb(cont, cont_scroll_end_event_cb, LV_EVENT_SCROLL_END, NULL);
lv_obj_set_scrollbar_mode(cont, LV_SCROLLBAR_MODE_OFF);
lv_tabview_set_tab_bar_position(obj, LV_DIR_TOP);
+2 -1
View File
@@ -948,7 +948,8 @@ static void lv_textarea_constructor(const lv_obj_class_t * class_p, lv_obj_t * o
ta->label = lv_label_create(obj);
lv_obj_set_width(ta->label, lv_pct(100));
lv_label_set_text(ta->label, "");
lv_obj_add_event_cb(ta->label, label_event_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ta->label, label_event_cb, LV_EVENT_STYLE_CHANGED, NULL);
lv_obj_add_event_cb(ta->label, label_event_cb, LV_EVENT_SIZE_CHANGED, NULL);
lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS);
lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_WITH_ARROW);
+1 -2
View File
@@ -133,11 +133,10 @@ static void lv_tileview_constructor(const lv_obj_class_t * class_p, lv_obj_t * o
{
LV_UNUSED(class_p);
lv_obj_set_size(obj, LV_PCT(100), LV_PCT(100));
lv_obj_add_event_cb(obj, tileview_event_cb, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(obj, tileview_event_cb, LV_EVENT_SCROLL_END, NULL);
lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ONE);
lv_obj_set_scroll_snap_x(obj, LV_SCROLL_SNAP_CENTER);
lv_obj_set_scroll_snap_y(obj, LV_SCROLL_SNAP_CENTER);
}
static void lv_tileview_tile_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj)