From b56107ae05fe0d720b008c1665c1fe4660ce90f3 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 15 Nov 2023 22:47:53 +0100 Subject: [PATCH] refactor: fix typos --- demos/keypad_encoder/lv_demo_keypad_encoder.py | 2 +- docs/widgets/span.rst | 4 ++-- examples/scroll/lv_example_scroll_6.py | 2 +- examples/widgets/list/lv_example_list_2.py | 6 +++--- examples/widgets/tabview/lv_example_tabview_1.py | 2 +- examples/widgets/tabview/lv_example_tabview_2.py | 2 +- src/widgets/span/lv_span.c | 2 +- src/widgets/span/lv_span.h | 2 +- tests/src/test_cases/widgets/test_span.c | 10 +++++----- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/demos/keypad_encoder/lv_demo_keypad_encoder.py b/demos/keypad_encoder/lv_demo_keypad_encoder.py index 4c8b98d21..fec99d422 100644 --- a/demos/keypad_encoder/lv_demo_keypad_encoder.py +++ b/demos/keypad_encoder/lv_demo_keypad_encoder.py @@ -17,7 +17,7 @@ class KeyboardEncoder: cur_drv = cur_drv.get_next() - self.tv = lv.tabview(lv.screen_active(), lv.DIR.TOP, lv.DPI_DEF // 3) + self.tv = lv.tabview(lv.screen_active()) self.t1 = self.tv.add_tab("Selectors") self.t2 = self.tv.add_tab("Text input") diff --git a/docs/widgets/span.rst b/docs/widgets/span.rst index c4a9dbe75..6f15fd1f3 100644 --- a/docs/widgets/span.rst +++ b/docs/widgets/span.rst @@ -48,10 +48,10 @@ the last (or most recent) child. Child Count ----------- -Use the function :cpp:expr:`lv_spangroup_get_child_conut(spangroup)` to get back +Use the function :cpp:expr:`lv_spangroup_get_child_count(spangroup)` to get back the number of spans the group is maintaining. -e.g. ``uint32_t size = lv_spangroup_get_child_conut(spangroup)`` +e.g. ``uint32_t size = lv_spangroup_get_child_count(spangroup)`` Text align ---------- diff --git a/examples/scroll/lv_example_scroll_6.py b/examples/scroll/lv_example_scroll_6.py index f4b5d1a7e..4f5aa5b96 100644 --- a/examples/scroll/lv_example_scroll_6.py +++ b/examples/scroll/lv_example_scroll_6.py @@ -8,7 +8,7 @@ def scroll_event_cb(e): r = cont.get_height() * 7 // 10 - child_cnt = cont.get_child_conut() + child_cnt = cont.get_child_count() for i in range(child_cnt): child = cont.get_child(i) child_a = lv.area_t() diff --git a/examples/widgets/list/lv_example_list_2.py b/examples/widgets/list/lv_example_list_2.py index eae8e9f11..df83ea417 100644 --- a/examples/widgets/list/lv_example_list_2.py +++ b/examples/widgets/list/lv_example_list_2.py @@ -13,7 +13,7 @@ def event_handler(e): else: currentButton = obj parent = obj.get_parent() - for i in range( parent.get_child_conut()): + for i in range( parent.get_child_count()): child = parent.get_child(i) if child == currentButton: child.add_state(lv.STATE.CHECKED) @@ -51,7 +51,7 @@ def event_handler_center(e): if currentButton == None: return parent = currentButton.get_parent() - pos = parent.get_child_conut() // 2 + pos = parent.get_child_count() // 2 currentButton.move_to_index(pos) currentButton.scroll_to_view(lv.ANIM.ON) @@ -82,7 +82,7 @@ def event_handler_swap(e): code = e.get_code() obj = e.get_target_obj() if code == lv.EVENT.CLICKED: - cnt = list1.get_child_conut() + cnt = list1.get_child_count() for i in range(100): if cnt > 1: obj = list1.get_child(urandom.getrandbits(32) % cnt ) diff --git a/examples/widgets/tabview/lv_example_tabview_1.py b/examples/widgets/tabview/lv_example_tabview_1.py index f57cf995a..5c2394a91 100644 --- a/examples/widgets/tabview/lv_example_tabview_1.py +++ b/examples/widgets/tabview/lv_example_tabview_1.py @@ -1,5 +1,5 @@ # Create a Tab view object -tabview = lv.tabview(lv.screen_active(), lv.DIR.TOP, 50) +tabview = lv.tabview(lv.screen_active()) # Add 3 tabs (the tabs are page (lv_page) and can be scrolled tab1 = tabview.add_tab("Tab 1") diff --git a/examples/widgets/tabview/lv_example_tabview_2.py b/examples/widgets/tabview/lv_example_tabview_2.py index d3a90b6f9..5378f0b57 100644 --- a/examples/widgets/tabview/lv_example_tabview_2.py +++ b/examples/widgets/tabview/lv_example_tabview_2.py @@ -1,6 +1,6 @@ # Create a Tab view object -tabview = lv.tabview(lv.screen_active(), lv.DIR.LEFT, 80) +tabview = lv.tabview(lv.screen_active()) tabview.set_style_bg_color(lv.palette_lighten(lv.PALETTE.RED, 2), 0) diff --git a/src/widgets/span/lv_span.c b/src/widgets/span/lv_span.c index 2592daf2d..33f317ea5 100644 --- a/src/widgets/span/lv_span.c +++ b/src/widgets/span/lv_span.c @@ -286,7 +286,7 @@ lv_span_t * lv_spangroup_get_child(const lv_obj_t * obj, int32_t id) return NULL; } -uint32_t lv_spangroup_get_child_conut(const lv_obj_t * obj) +uint32_t lv_spangroup_get_child_count(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); diff --git a/src/widgets/span/lv_span.h b/src/widgets/span/lv_span.h index 86cf4587d..cb1c49cc9 100644 --- a/src/widgets/span/lv_span.h +++ b/src/widgets/span/lv_span.h @@ -179,7 +179,7 @@ lv_span_t * lv_spangroup_get_child(const lv_obj_t * obj, int32_t id); * @param obj The spangroup object to get the child count of. * @return The span count of the spangroup. */ -uint32_t lv_spangroup_get_child_conut(const lv_obj_t * obj); +uint32_t lv_spangroup_get_child_count(const lv_obj_t * obj); /** * get the align of the spangroup. diff --git a/tests/src/test_cases/widgets/test_span.c b/tests/src/test_cases/widgets/test_span.c index 6e18999d9..f11a30ecd 100644 --- a/tests/src/test_cases/widgets/test_span.c +++ b/tests/src/test_cases/widgets/test_span.c @@ -35,7 +35,7 @@ void test_spangroup_new_span_with_null_parameter_returns_null_object(void) lv_span_t * span = lv_spangroup_new_span(NULL); TEST_ASSERT(NULL == span); - TEST_ASSERT_EQUAL_INT(0, lv_spangroup_get_child_conut(spangroup)); + TEST_ASSERT_EQUAL_INT(0, lv_spangroup_get_child_count(spangroup)); } void test_spangroup_new_span_with_valid_parameter_returns_not_null_object(void) @@ -43,7 +43,7 @@ void test_spangroup_new_span_with_valid_parameter_returns_not_null_object(void) lv_span_t * span = lv_spangroup_new_span(spangroup); TEST_ASSERT(NULL != span); - TEST_ASSERT_EQUAL_INT(1, lv_spangroup_get_child_conut(spangroup)); + TEST_ASSERT_EQUAL_INT(1, lv_spangroup_get_child_count(spangroup)); } void test_spangroup_delete_span_span_is_null(void) @@ -52,7 +52,7 @@ void test_spangroup_delete_span_span_is_null(void) lv_spangroup_delete_span(spangroup, span); - TEST_ASSERT_EQUAL_INT(0, lv_spangroup_get_child_conut(spangroup)); + TEST_ASSERT_EQUAL_INT(0, lv_spangroup_get_child_count(spangroup)); } void test_span_set_text(void) @@ -249,12 +249,12 @@ void test_spangroup_get_child(void) TEST_ASSERT_EQUAL_PTR(span_1, lv_spangroup_get_child(spangroup, span_1_idx)); } -void test_spangroup_get_child_conut(void) +void test_spangroup_get_child_count(void) { (void)lv_spangroup_new_span(spangroup); (void)lv_spangroup_new_span(spangroup); - const uint32_t cnt = lv_spangroup_get_child_conut(spangroup); + const uint32_t cnt = lv_spangroup_get_child_count(spangroup); TEST_ASSERT_EQUAL(2, cnt); }