From f509d8fa4f90a2cd2737f8b320c30de0081da737 Mon Sep 17 00:00:00 2001 From: Themba Dube Date: Wed, 27 Feb 2019 10:55:39 +0100 Subject: [PATCH 1/3] Apply ta label size fix from dev-6.0 --- lv_objx/lv_ta.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lv_objx/lv_ta.c b/lv_objx/lv_ta.c index 69c12ce03..e3492a039 100644 --- a/lv_objx/lv_ta.c +++ b/lv_objx/lv_ta.c @@ -1104,6 +1104,8 @@ static lv_res_t lv_ta_signal(lv_obj_t * ta, lv_signal_t sign, void * param) static lv_res_t lv_ta_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, void * param) { lv_res_t res; + lv_obj_t * ta = lv_obj_get_parent(scrl); + lv_ta_ext_t * ext = lv_obj_get_ext_attr(ta); /* Include the ancient signal function */ res = scrl_signal(scrl, sign, param); @@ -1111,12 +1113,27 @@ static lv_res_t lv_ta_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, void if(sign == LV_SIGNAL_REFR_EXT_SIZE) { /*Set ext. size because the cursor might be out of this object*/ - lv_obj_t * ta = lv_obj_get_parent(scrl); - lv_ta_ext_t * ext = lv_obj_get_ext_attr(ta); lv_style_t * style_label = lv_obj_get_style(ext->label); lv_coord_t font_h = lv_font_get_height(style_label->text.font); scrl->ext_size = LV_MATH_MAX(scrl->ext_size, style_label->text.line_space + font_h); } +#if 0 + else if(sign == LV_SIGNAL_CORD_CHG) { + /*Set the label width according to the text area width*/ + if(ext->label) { + if(lv_obj_get_width(ta) != lv_area_get_width(param) || + lv_obj_get_height(ta) != lv_area_get_height(param)) { + lv_obj_t * scrl = lv_page_get_scrl(ta); + lv_style_t * style_scrl = lv_obj_get_style(scrl); + lv_obj_set_width(ext->label, lv_obj_get_width(scrl) - 2 * style_scrl->body.padding.hor); + lv_obj_set_pos(ext->label, style_scrl->body.padding.hor, style_scrl->body.padding.ver); + lv_label_set_text(ext->label, NULL); /*Refresh the label*/ + + refr_cursor_area(ta); + } + } + } +#endif return res; } From 6f53e4616a2b84d34993062bf55b3e49c64b49ae Mon Sep 17 00:00:00 2001 From: Amir Gonnen Date: Sun, 3 Mar 2019 00:11:36 +0200 Subject: [PATCH 2/3] Workaround for stray 'free' macro Related to littlevgl/lv_binding_micropython#11 'Build error for STM32 port due to 'free()' macro' --- lv_misc/lv_fs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lv_misc/lv_fs.c b/lv_misc/lv_fs.c index 64edc1032..1828e39ff 100644 --- a/lv_misc/lv_fs.c +++ b/lv_misc/lv_fs.c @@ -21,6 +21,14 @@ * DEFINES *********************/ +/* "free" is used as a function pointer (in lv_fs_drv_t). + * We must make sure "free" was not defined to a platform specific + * free function, otherwise compilation would fail. + */ +#ifdef free +#undef free +#endif + /********************** * TYPEDEFS **********************/ From b8c6783207ce8060a25cddb730edd63ee72abfd3 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Sun, 3 Mar 2019 08:13:13 +0100 Subject: [PATCH 3/3] Update README.md --- README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index cadf11e16..8ffb2a691 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Choose a project with your favourite IDE: ### Porting to an embedded hardware In the most simple case you need to do these steps: 1. Copy `lv_conf_templ.h` as `lv_conf.h` next to `lvgl` and set at least `LV_HOR_RES`, `LV_VER_RES` and `LV_COLOR_DEPTH`. -2. Call `lv_tick_inc(x)` every `x` milliseconds **in a Timer or Task** (`x` should be between 1 and 10) +2. Call `lv_tick_inc(x)` every `x` milliseconds **in a Timer or Task** (`x` should be between 1 and 10). It is required for the internal timing of LittlevGL. 3. Call `lv_init()` 4. Register a function which can **copy a pixel array** to an area of the screen: ```c @@ -117,7 +117,7 @@ bool touchpad_read(lv_indev_data_t * data) return false; /*Return `false` because we are not buffering and no more data to read*/ } ``` -6. Call `lv_task_handler()` periodically every few milliseconds in the main `while(1)` loop, in Timer interrupt or in an Operation system task. +6. Call `lv_task_handler()` periodically every few milliseconds in the main `while(1)` loop, in Timer interrupt or in an Operation system task. It will redraw the screen if required, handle input devices etc. For a detailed description check the [Documentation](https://docs.littlevgl.com/#Porting) or the [Porting tutorial](https://github.com/littlevgl/lv_examples/blob/master/lv_tutorial/0_porting/lv_tutorial_porting.c) @@ -180,9 +180,7 @@ lv_btn_set_ink_out_time(btn, 300); #### Use LittlevGL from Micropython ```python - # Create a Button and a Label - scr = lv.obj() btn = lv.btn(scr) btn.align(lv.scr_act(), lv.ALIGN.CENTER, 0, 0) @@ -190,16 +188,16 @@ label = lv.label(btn) label.set_text("Button") # Load the screen - lv.scr_load(scr) ``` Check out the [Documentation](https://docs.littlevgl.com/) for more! ### Contributing -To ask questions and discuss topics we use [GitHub's Issue tracker](https://github.com/littlevgl/lvgl/issues). -You contribute in several ways: -- **Answer other's question** click the Watch button on the top to get notified about the issues +To ask questions please use the [Forum](https://forum.littlevgl.com). +FOr development related things (bug reports, feature suggestions) use [GitHub's Issue tracker](https://github.com/littlevgl/lvgl/issues). +You can contribute in several ways: +- **Answer other's question** in the Forum - **Report and/or fix bugs** using the issue tracker and in Pull-request - **Suggest and/or implement new features** using the issue tracker and in Pull-request - **Improve and/or translate the documentation** learn more [here](https://github.com/littlevgl/docs)