From 075fe54537e4b5623999670dfab54acd0008c54f Mon Sep 17 00:00:00 2001 From: rockindy Date: Mon, 31 Aug 2020 16:15:42 +0800 Subject: [PATCH] Fix lv_page_glue_obj() interface for lv_binding_micropython. (#1759) --- src/lv_widgets/lv_list.c | 2 +- src/lv_widgets/lv_page.c | 3 ++- src/lv_widgets/lv_page.h | 3 ++- src/lv_widgets/lv_tileview.c | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lv_widgets/lv_list.c b/src/lv_widgets/lv_list.c index 5a1cfb144..fd8d5a41a 100644 --- a/src/lv_widgets/lv_list.c +++ b/src/lv_widgets/lv_list.c @@ -170,7 +170,7 @@ lv_obj_t * lv_list_add_btn(lv_obj_t * list, const void * img_src, const char * t /*Set the default styles*/ lv_theme_apply(btn, LV_THEME_LIST_BTN); - lv_page_glue_obj(btn, true); + lv_page_glue_obj(list, btn, true); lv_btn_set_layout(btn, LV_LAYOUT_ROW_MID); lv_layout_t list_layout = lv_list_get_layout(list); diff --git a/src/lv_widgets/lv_page.c b/src/lv_widgets/lv_page.c index f2330de78..0c81100a0 100644 --- a/src/lv_widgets/lv_page.c +++ b/src/lv_widgets/lv_page.c @@ -457,10 +457,11 @@ bool lv_page_on_edge(lv_obj_t * page, lv_page_edge_t edge) /** * Glue the object to the page. After it the page can be moved (dragged) with this object too. + * @param page pointer to a page object * @param obj pointer to an object on a page * @param glue true: enable glue, false: disable glue */ -void lv_page_glue_obj(lv_obj_t * obj, bool glue) +void lv_page_glue_obj(lv_obj_t * page, lv_obj_t * obj, bool glue) { lv_obj_set_drag_parent(obj, glue); lv_obj_set_drag(obj, glue); diff --git a/src/lv_widgets/lv_page.h b/src/lv_widgets/lv_page.h index 051dce509..387afc6e7 100644 --- a/src/lv_widgets/lv_page.h +++ b/src/lv_widgets/lv_page.h @@ -378,10 +378,11 @@ bool lv_page_on_edge(lv_obj_t * page, lv_page_edge_t edge); /** * Glue the object to the page. After it the page can be moved (dragged) with this object too. + * @param page pointer to a page object * @param obj pointer to an object on a page * @param glue true: enable glue, false: disable glue */ -void lv_page_glue_obj(lv_obj_t * obj, bool glue); +void lv_page_glue_obj(lv_obj_t * page, lv_obj_t * obj, bool glue); /** * Focus on an object. It ensures that the object will be visible on the page. diff --git a/src/lv_widgets/lv_tileview.c b/src/lv_widgets/lv_tileview.c index 0b471b83f..73014a7f5 100644 --- a/src/lv_widgets/lv_tileview.c +++ b/src/lv_widgets/lv_tileview.c @@ -156,7 +156,7 @@ void lv_tileview_add_element(lv_obj_t * tileview, lv_obj_t * element) LV_ASSERT_OBJ(tileview, LV_OBJX_NAME); LV_ASSERT_NULL(tileview); - lv_page_glue_obj(element, true); + lv_page_glue_obj(tileview, element, true); } /*=====================