From 1a0b6d313e5b2e8dc3bc943c36badc590f03fe92 Mon Sep 17 00:00:00 2001 From: Victor Wheeler Date: Fri, 29 Nov 2024 09:42:39 -0700 Subject: [PATCH] feat(chart,calendar): two grammar corrections (#7340) --- demos/widgets/lv_demo_widgets.c | 2 +- docs/details/widgets/calendar.rst | 2 +- docs/details/widgets/chart.rst | 2 +- examples/widgets/calendar/lv_example_calendar_1.c | 2 +- examples/widgets/calendar/lv_example_calendar_2.c | 2 +- src/lv_api_map_v9_1.h | 4 +++- src/widgets/calendar/lv_calendar.c | 4 ++-- src/widgets/calendar/lv_calendar.h | 2 +- src/widgets/calendar/lv_calendar_chinese.c | 2 +- src/widgets/calendar/lv_calendar_header_arrow.c | 2 +- src/widgets/calendar/lv_calendar_header_dropdown.c | 4 ++-- src/widgets/chart/lv_chart.c | 2 +- src/widgets/chart/lv_chart.h | 2 +- 13 files changed, 17 insertions(+), 15 deletions(-) diff --git a/demos/widgets/lv_demo_widgets.c b/demos/widgets/lv_demo_widgets.c index 33ba10fc3..d5c8b6922 100644 --- a/demos/widgets/lv_demo_widgets.c +++ b/demos/widgets/lv_demo_widgets.c @@ -1324,7 +1324,7 @@ static void birthday_event_cb(lv_event_t * e) if(disp_size == DISP_SMALL) lv_obj_set_size(calendar, 180, 200); else if(disp_size == DISP_MEDIUM) lv_obj_set_size(calendar, 200, 220); else lv_obj_set_size(calendar, 300, 330); - lv_calendar_set_showed_date(calendar, 1990, 01); + lv_calendar_set_month_shown(calendar, 1990, 01); lv_obj_align(calendar, LV_ALIGN_CENTER, 0, 30); lv_obj_add_event_cb(calendar, calendar_event_cb, LV_EVENT_ALL, ta); diff --git a/docs/details/widgets/calendar.rst b/docs/details/widgets/calendar.rst index 4ffa81e3c..cc4f3c1e8 100644 --- a/docs/details/widgets/calendar.rst +++ b/docs/details/widgets/calendar.rst @@ -59,7 +59,7 @@ Month shown ----------- To set the shown date, use -:cpp:expr:`lv_calendar_set_showed_date(calendar, year, month)` +:cpp:expr:`lv_calendar_set_month_shown(calendar, year, month)` Highlighted days ---------------- diff --git a/docs/details/widgets/chart.rst b/docs/details/widgets/chart.rst index 80b9cf2a2..88353536c 100644 --- a/docs/details/widgets/chart.rst +++ b/docs/details/widgets/chart.rst @@ -225,7 +225,7 @@ You have several options to set the Y-values for a data series: the zero-based index of the point you wish to update. 3. Use :cpp:expr:`lv_chart_set_next_value(chart, series, value)`. (See `Update modes`_ below.) -4. Set all points to a single Y-value with :cpp:expr:`lv_chart_set_all_value(chart, series, value)`. +4. Set all points to a single Y-value with :cpp:expr:`lv_chart_set_all_values(chart, series, value)`. Use :c:macro:`LV_CHART_POINT_NONE` as value to make the library skip drawing that point, column, or scatter-point. diff --git a/examples/widgets/calendar/lv_example_calendar_1.c b/examples/widgets/calendar/lv_example_calendar_1.c index 9fe71447e..ff9c077e6 100644 --- a/examples/widgets/calendar/lv_example_calendar_1.c +++ b/examples/widgets/calendar/lv_example_calendar_1.c @@ -22,7 +22,7 @@ void lv_example_calendar_1(void) lv_obj_add_event_cb(calendar, event_handler, LV_EVENT_ALL, NULL); lv_calendar_set_today_date(calendar, 2021, 02, 23); - lv_calendar_set_showed_date(calendar, 2021, 02); + lv_calendar_set_month_shown(calendar, 2021, 02); /*Highlight a few days*/ static lv_calendar_date_t highlighted_days[3]; /*Only its pointer will be saved so should be static*/ diff --git a/examples/widgets/calendar/lv_example_calendar_2.c b/examples/widgets/calendar/lv_example_calendar_2.c index 548b7134a..a9b2ce9e4 100644 --- a/examples/widgets/calendar/lv_example_calendar_2.c +++ b/examples/widgets/calendar/lv_example_calendar_2.c @@ -8,7 +8,7 @@ void lv_example_calendar_2(void) lv_obj_align(calendar, LV_ALIGN_TOP_MID, 0, 0); lv_calendar_set_today_date(calendar, 2024, 03, 22); - lv_calendar_set_showed_date(calendar, 2024, 03); + lv_calendar_set_month_shown(calendar, 2024, 03); #if LV_USE_CALENDAR_HEADER_DROPDOWN lv_calendar_header_dropdown_create(calendar); diff --git a/src/lv_api_map_v9_1.h b/src/lv_api_map_v9_1.h index a142b4066..73494a4ee 100644 --- a/src/lv_api_map_v9_1.h +++ b/src/lv_api_map_v9_1.h @@ -78,6 +78,8 @@ extern "C" { #define _lv_disp_get_refr_timer lv_disp_get_refr_timer #define _lv_inv_area lv_inv_area +#define lv_chart_set_all_value lv_chart_set_all_values +#define lv_calendar_set_showed_date lv_calendar_set_month_shown /********************** * DEPRECATED FUNCTIONS @@ -87,4 +89,4 @@ extern "C" { } /*extern "C"*/ #endif -#endif /*LV_API_MAP_V9_0_H*/ +#endif /* LV_API_MAP_V9_1_H */ diff --git a/src/widgets/calendar/lv_calendar.c b/src/widgets/calendar/lv_calendar.c index 560e24a1d..acf66ccaa 100644 --- a/src/widgets/calendar/lv_calendar.c +++ b/src/widgets/calendar/lv_calendar.c @@ -117,7 +117,7 @@ void lv_calendar_set_highlighted_dates(lv_obj_t * obj, lv_calendar_date_t highli highlight_update(obj); } -void lv_calendar_set_showed_date(lv_obj_t * obj, uint32_t year, uint32_t month) +void lv_calendar_set_month_shown(lv_obj_t * obj, uint32_t year, uint32_t month) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_calendar_t * calendar = (lv_calendar_t *)obj; @@ -332,7 +332,7 @@ static void lv_calendar_constructor(const lv_obj_class_t * class_p, lv_obj_t * o lv_obj_set_style_text_align(obj, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN); - lv_calendar_set_showed_date(obj, calendar->showed_date.year, calendar->showed_date.month); + lv_calendar_set_month_shown(obj, calendar->showed_date.year, calendar->showed_date.month); lv_calendar_set_today_date(obj, calendar->today.year, calendar->today.month, calendar->today.day); } diff --git a/src/widgets/calendar/lv_calendar.h b/src/widgets/calendar/lv_calendar.h index 38c5d644f..c7159a360 100644 --- a/src/widgets/calendar/lv_calendar.h +++ b/src/widgets/calendar/lv_calendar.h @@ -70,7 +70,7 @@ void lv_calendar_set_today_date(lv_obj_t * obj, uint32_t year, uint32_t month, u * @param year today's year * @param month today's month [1..12] */ -void lv_calendar_set_showed_date(lv_obj_t * obj, uint32_t year, uint32_t month); +void lv_calendar_set_month_shown(lv_obj_t * obj, uint32_t year, uint32_t month); /** * Set the highlighted dates diff --git a/src/widgets/calendar/lv_calendar_chinese.c b/src/widgets/calendar/lv_calendar_chinese.c index ee24133ad..76995fdfc 100644 --- a/src/widgets/calendar/lv_calendar_chinese.c +++ b/src/widgets/calendar/lv_calendar_chinese.c @@ -116,7 +116,7 @@ void lv_calendar_set_chinese_mode(lv_obj_t * obj, bool en) { lv_calendar_t * calendar = (lv_calendar_t *)obj; calendar->use_chinese_calendar = en; - lv_calendar_set_showed_date(obj, calendar->today.year, calendar->today.month); + lv_calendar_set_month_shown(obj, calendar->today.year, calendar->today.month); } const char * lv_calendar_get_day_name(lv_calendar_date_t * gregorian) diff --git a/src/widgets/calendar/lv_calendar_header_arrow.c b/src/widgets/calendar/lv_calendar_header_arrow.c index 09b201d04..680a93df6 100644 --- a/src/widgets/calendar/lv_calendar_header_arrow.c +++ b/src/widgets/calendar/lv_calendar_header_arrow.c @@ -136,7 +136,7 @@ static void month_event_cb(lv_event_t * e) } } - lv_calendar_set_showed_date(calendar, newd.year, newd.month); + lv_calendar_set_month_shown(calendar, newd.year, newd.month); lv_obj_t * label = lv_obj_get_child(header, 1); lv_label_set_text_fmt(label, "%d %s", newd.year, month_names_def[newd.month - 1]); diff --git a/src/widgets/calendar/lv_calendar_header_dropdown.c b/src/widgets/calendar/lv_calendar_header_dropdown.c index 41fe53a82..dfa35632f 100644 --- a/src/widgets/calendar/lv_calendar_header_dropdown.c +++ b/src/widgets/calendar/lv_calendar_header_dropdown.c @@ -135,7 +135,7 @@ static void month_event_cb(lv_event_t * e) lv_calendar_date_t newd = *d; newd.month = sel + 1; - lv_calendar_set_showed_date(calendar, newd.year, newd.month); + lv_calendar_set_month_shown(calendar, newd.year, newd.month); } static void year_event_cb(lv_event_t * e) @@ -157,7 +157,7 @@ static void year_event_cb(lv_event_t * e) lv_calendar_date_t newd = *d; newd.year = year - sel; - lv_calendar_set_showed_date(calendar, newd.year, newd.month); + lv_calendar_set_month_shown(calendar, newd.year, newd.month); } static void value_changed_event_cb(lv_event_t * e) diff --git a/src/widgets/chart/lv_chart.c b/src/widgets/chart/lv_chart.c index cd9c942b5..b22c1b755 100644 --- a/src/widgets/chart/lv_chart.c +++ b/src/widgets/chart/lv_chart.c @@ -471,7 +471,7 @@ lv_point_t lv_chart_get_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * curso * Set/Get value(s) *====================*/ -void lv_chart_set_all_value(lv_obj_t * obj, lv_chart_series_t * ser, int32_t value) +void lv_chart_set_all_values(lv_obj_t * obj, lv_chart_series_t * ser, int32_t value) { LV_ASSERT_OBJ(obj, MY_CLASS); LV_ASSERT_NULL(ser); diff --git a/src/widgets/chart/lv_chart.h b/src/widgets/chart/lv_chart.h index de2583146..c07234c4d 100644 --- a/src/widgets/chart/lv_chart.h +++ b/src/widgets/chart/lv_chart.h @@ -256,7 +256,7 @@ lv_point_t lv_chart_get_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * curso * @param ser pointer to a data series on 'chart' * @param value the new value for all points. `LV_CHART_POINT_NONE` can be used to hide the points. */ -void lv_chart_set_all_value(lv_obj_t * obj, lv_chart_series_t * ser, int32_t value); +void lv_chart_set_all_values(lv_obj_t * obj, lv_chart_series_t * ser, int32_t value); /** * Set the next point's Y value according to the update mode policy.