fix some examples

This commit is contained in:
Gabor Kiss-Vamosi
2021-05-27 15:12:50 +02:00
parent 1a3e704b25
commit 98c3c8eb5c
8 changed files with 11 additions and 11 deletions

View File

@@ -41,7 +41,7 @@ Learn more about [Keys](/overview/indev).
```eval_rst
.. include:: /lv_examples/src/lv_ex_widgets/lv_ex_list/index.rst
.. include:: ../../../examples/widgets/list/index.rst
```

View File

@@ -36,9 +36,6 @@ Learn more about [Keys](/overview/indev).
```
### MicroPython
No examples yet.
## API
```eval_rst

View File

@@ -17,8 +17,8 @@ static void event_handler(lv_event_t * e)
void lv_example_calendar_1(void)
{
lv_obj_t * calendar = lv_calendar_create(lv_scr_act());
lv_obj_set_size(calendar, 200, 200);
lv_obj_align(calendar, LV_ALIGN_CENTER, 0, 20);
lv_obj_set_size(calendar, 185, 185);
lv_obj_align(calendar, LV_ALIGN_CENTER, 0, 27);
lv_obj_add_event_cb(calendar, event_handler, LV_EVENT_ALL, NULL);
lv_calendar_set_today_date(calendar, 2021, 02, 23);

View File

@@ -28,10 +28,12 @@ void lv_example_keyboard_1(void)
lv_obj_align(ta, LV_ALIGN_TOP_LEFT, 10, 10);
lv_obj_add_event_cb(ta, ta_event_cb, LV_EVENT_ALL, kb);
lv_textarea_set_placeholder_text(ta, "Hello");
lv_obj_set_size(ta, 140, 80);
ta = lv_textarea_create(lv_scr_act());
lv_obj_align(ta, LV_ALIGN_TOP_RIGHT, -10, 10);
lv_obj_add_event_cb(ta, ta_event_cb, LV_EVENT_ALL, kb);
lv_obj_set_size(ta, 140, 80);
lv_keyboard_set_textarea(kb, ta);
}

View File

@@ -4,7 +4,7 @@ C
LED with custom style
"""""""""""""""""""""
.. lv_example:: lv_ex_widgets/lv_ex_led/lv_ex_led_1
.. lv_example:: widgets/led/lv_example_led_1
:language: c
MicroPython

View File

@@ -4,7 +4,7 @@ C
Simple List
""""""""""""""""
.. lv_example:: lv_ex_widgets/lv_ex_list/lv_ex_list_1
.. lv_example:: widgets/list/lv_example_list_1
:language: c
MicroPython

View File

@@ -10,7 +10,7 @@ static void event_handler(lv_event_t * e)
void lv_example_win_1(void)
{
lv_obj_t * win = lv_win_create(lv_scr_act(), 60);
lv_obj_t * win = lv_win_create(lv_scr_act(), 40);
lv_obj_t * btn;
btn = lv_win_add_btn(win, LV_SYMBOL_LEFT, 40);
lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL);

View File

@@ -824,8 +824,9 @@ static void draw_series_line(lv_obj_t * obj, const lv_area_t * clip_area)
uint16_t i;
lv_point_t p1;
lv_point_t p2;
lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN);
lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN);
lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN);
lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width;
lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + border_width;
lv_coord_t w = (lv_obj_get_content_width(obj) * chart->zoom_x) >> 8;
lv_coord_t h = (lv_obj_get_content_height(obj) * chart->zoom_y) >> 8;
lv_coord_t x_ofs = obj->coords.x1 + pad_left - lv_obj_get_scroll_left(obj);