From 39395465a2a0137d829024ef6715aece78ec859e Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 16 Oct 2018 16:08:13 +0200 Subject: [PATCH 1/6] fix version number --- lvgl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lvgl.h b/lvgl.h index 3f3084c81..dbedb4f68 100644 --- a/lvgl.h +++ b/lvgl.h @@ -61,7 +61,7 @@ extern "C" { *********************/ /*Current version of LittlevGL*/ #define LVGL_VERSION_MAJOR 5 -#define LVGL_VERSION_MINOR 3 +#define LVGL_VERSION_MINOR 2 #define LVGL_VERSION_PATCH 0 #define LVGL_VERSION_INFO "" From be24c90532c152ef2a53385821037574b7132324 Mon Sep 17 00:00:00 2001 From: fallstool Date: Wed, 17 Oct 2018 14:20:39 +0800 Subject: [PATCH 2/6] Update lv_ta.h --- lv_objx/lv_ta.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lv_objx/lv_ta.h b/lv_objx/lv_ta.h index 281a84f13..b97c67c49 100644 --- a/lv_objx/lv_ta.h +++ b/lv_objx/lv_ta.h @@ -68,7 +68,7 @@ typedef struct lv_style_t *style; /*Style of the cursor (NULL to use label's style)*/ lv_coord_t valid_x; /*Used when stepping up/down in text area when stepping to a shorter line. (Handled by the library)*/ uint16_t pos; /*The current cursor position (0: before 1. letter; 1: before 2. letter etc.)*/ - lv_cursor_type_t type:2; /*Shape of the cursor*/ + lv_cursor_type_t type:3; /*Shape of the cursor*/ uint8_t state :1; /*Indicates that the cursor is visible now or not (Handled by the library)*/ } cursor; } lv_ta_ext_t; From c9111563b10619131a410c811831c909453a85f5 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 17 Oct 2018 05:42:27 +0200 Subject: [PATCH 3/6] add lv_cont/page_get_width/height --- lv_objx/lv_cont.c | 24 ++++++++++++++++++++++++ lv_objx/lv_cont.h | 15 +++++++++++++++ lv_objx/lv_page.c | 26 ++++++++++++++++++++++++++ lv_objx/lv_page.h | 15 +++++++++++++++ 4 files changed, 80 insertions(+) diff --git a/lv_objx/lv_cont.c b/lv_objx/lv_cont.c index 89da6ad22..304852a22 100644 --- a/lv_objx/lv_cont.c +++ b/lv_objx/lv_cont.c @@ -189,6 +189,30 @@ bool lv_cont_get_ver_fit(const lv_obj_t * cont) return ext->ver_fit == 0 ? false : true; } +/** + * Get that width reduced by the horizontal padding. Useful if a layout is used. + * @param cont pointer to a container object + * @return the width which still fits into the container + */ +lv_coord_t lv_cont_get_fit_width(lv_obj_t * cont) +{ + lv_style_t * style = lv_cont_get_style(cont); + + return lv_obj_get_width(cont) - 2 * style->body.padding.hor; +} + +/** + * Get that height reduced by the vertical padding. Useful if a layout is used. + * @param cont pointer to a container object + * @return the height which still fits into the container + */ +lv_coord_t lv_cont_get_fit_height(lv_obj_t * cont) +{ + lv_style_t * style = lv_cont_get_style(cont); + + return lv_obj_get_width(cont) - 2 * style->body.padding.hor; +} + /********************** * STATIC FUNCTIONS **********************/ diff --git a/lv_objx/lv_cont.h b/lv_objx/lv_cont.h index f1c37fac7..3259c772f 100644 --- a/lv_objx/lv_cont.h +++ b/lv_objx/lv_cont.h @@ -125,6 +125,21 @@ bool lv_cont_get_hor_fit(const lv_obj_t * cont); */ bool lv_cont_get_ver_fit(const lv_obj_t * cont); + +/** + * Get that width reduced by the horizontal padding. Useful if a layout is used. + * @param cont pointer to a container object + * @return the width which still fits into the container + */ +lv_coord_t lv_cont_get_fit_width(lv_obj_t * cont); + +/** + * Get that height reduced by the vertical padding. Useful if a layout is used. + * @param cont pointer to a container object + * @return the height which still fits into the container + */ +lv_coord_t lv_cont_get_fit_height(lv_obj_t * cont); + /** * Get the style of a container * @param cont pointer to a container object diff --git a/lv_objx/lv_page.c b/lv_objx/lv_page.c index ce27cae5c..9e19261d8 100644 --- a/lv_objx/lv_page.c +++ b/lv_objx/lv_page.c @@ -306,6 +306,32 @@ bool lv_page_get_arrow_scroll(const lv_obj_t * page) return ext->arrow_scroll ? true : false; } +/** + * Get that width which can be set to the children to still not cause overflow (show scrollbars) + * @param page pointer to a page object + * @return the width which still fits into the page + */ +lv_coord_t lv_page_get_fit_width(lv_obj_t * page) +{ + lv_style_t * bg_style = lv_page_get_style(page, LV_PAGE_STYLE_BG); + lv_style_t * scrl_style = lv_page_get_style(page, LV_PAGE_STYLE_SCRL); + + return lv_obj_get_width(page) - 2 * (bg_style->body.padding.hor + scrl_style->body.padding.hor); +} + +/** + * Get that height which can be set to the children to still not cause overflow (show scrollbars) + * @param page pointer to a page object + * @return the height which still fits into the page + */ +lv_coord_t lv_page_get_fit_height(lv_obj_t * page) +{ + lv_style_t * bg_style = lv_page_get_style(page, LV_PAGE_STYLE_BG); + lv_style_t * scrl_style = lv_page_get_style(page, LV_PAGE_STYLE_SCRL); + + return lv_obj_get_height(page) - 2 * (bg_style->body.padding.ver + scrl_style->body.padding.ver); +} + /** * Get a style of a page * @param page pointer to page object diff --git a/lv_objx/lv_page.h b/lv_objx/lv_page.h index 80f4fcb36..975452d09 100644 --- a/lv_objx/lv_page.h +++ b/lv_objx/lv_page.h @@ -217,6 +217,21 @@ lv_sb_mode_t lv_page_get_sb_mode(const lv_obj_t * page); */ bool lv_page_get_arrow_scroll(const lv_obj_t * page); + +/** + * Get that width which can be set to the children to still not cause overflow (show scrollbars) + * @param page pointer to a page object + * @return the width which still fits into the page + */ +lv_coord_t lv_page_get_fit_width(lv_obj_t * page); + +/** + * Get that height which can be set to the children to still not cause overflow (show scrollbars) + * @param page pointer to a page object + * @return the height which still fits into the page + */ +lv_coord_t lv_page_get_fit_height(lv_obj_t * page); + /** * Get width of the scrollable part of a page * @param page pointer to a page object From 4751cb16c91a9769b4eaf6e11e0008b036aa3c14 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 17 Oct 2018 11:27:08 +0200 Subject: [PATCH 4/6] minor fixes --- lv_core/lv_obj.c | 4 ++++ lv_objx/lv_list.c | 4 ++-- lv_objx/lv_mbox.c | 2 ++ lv_themes/lv_theme_alien.c | 8 ++++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lv_core/lv_obj.c b/lv_core/lv_obj.c index d8cba60c0..abeed35f9 100644 --- a/lv_core/lv_obj.c +++ b/lv_core/lv_obj.c @@ -778,6 +778,10 @@ void lv_obj_report_style_mod(lv_style_t * style) { lv_obj_t * i; LL_READ(scr_ll, i) { + if(i->style_p == style || style == NULL) { + lv_obj_refresh_style(i); + } + report_style_mod_core(style, i); } } diff --git a/lv_objx/lv_list.c b/lv_objx/lv_list.c index 67c2dd427..c0c994b65 100644 --- a/lv_objx/lv_list.c +++ b/lv_objx/lv_list.c @@ -408,7 +408,7 @@ lv_obj_t * lv_list_get_prev_btn(const lv_obj_t * list, lv_obj_t * prev_btn) if(btn == NULL) return NULL; while(btn->signal_func != lv_list_btn_signal) { - btn = lv_obj_get_child(scrl, prev_btn); + btn = lv_obj_get_child(scrl, btn); if(btn == NULL) break; } @@ -434,7 +434,7 @@ lv_obj_t * lv_list_get_next_btn(const lv_obj_t * list, lv_obj_t * prev_btn) if(btn == NULL) return NULL; while(btn->signal_func != lv_list_btn_signal) { - btn = lv_obj_get_child_back(scrl, prev_btn); + btn = lv_obj_get_child_back(scrl, btn); if(btn == NULL) break; } diff --git a/lv_objx/lv_mbox.c b/lv_objx/lv_mbox.c index 66fbfa3d6..388bfb6e7 100644 --- a/lv_objx/lv_mbox.c +++ b/lv_objx/lv_mbox.c @@ -276,6 +276,8 @@ void lv_mbox_set_style(lv_obj_t * mbox, lv_mbox_style_t type, lv_style_t * style break; } + mbox_realign(mbox); + } diff --git a/lv_themes/lv_theme_alien.c b/lv_themes/lv_theme_alien.c index 13fe40949..386efb61e 100644 --- a/lv_themes/lv_theme_alien.c +++ b/lv_themes/lv_theme_alien.c @@ -136,6 +136,13 @@ static void basic_init(void) } +static void cont_init(void) +{ +#if USE_LV_CONT != 0 + theme.cont = &panel; +#endif +} + static void btn_init(void) { #if USE_LV_BTN != 0 @@ -785,6 +792,7 @@ lv_theme_t * lv_theme_alien_init(uint16_t hue, lv_font_t * font) } basic_init(); + cont_init(); btn_init(); label_init(); bar_init(); From 63b9c5265fbc2666f2573145be4103d6aa631fa5 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 18 Oct 2018 06:59:41 +0200 Subject: [PATCH 5/6] lv_draw_img: fix to draw images with LV_COLOR_DEPTH 1 --- lv_draw/lv_draw_vbasic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lv_draw/lv_draw_vbasic.c b/lv_draw/lv_draw_vbasic.c index a756ddb2a..e23f15eaa 100644 --- a/lv_draw/lv_draw_vbasic.c +++ b/lv_draw/lv_draw_vbasic.c @@ -483,7 +483,7 @@ void lv_vmap(const lv_area_t * cords_p, const lv_area_t * mask_p, /*Calculate with the pixel level alpha*/ if(alpha_byte) { -#if LV_COLOR_DEPTH == 8 +#if LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1 px_color.full = px_color_p[0]; #elif LV_COLOR_DEPTH == 16 /*Because of Alpha byte 16 bit color can start on odd address which can cause crash*/ From e2ddaf7577c4818a087e2be705f1fc209043878e Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Sat, 20 Oct 2018 00:38:56 +0200 Subject: [PATCH 6/6] add rc tag --- lvgl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lvgl.h b/lvgl.h index dbedb4f68..6e74d53fa 100644 --- a/lvgl.h +++ b/lvgl.h @@ -63,7 +63,7 @@ extern "C" { #define LVGL_VERSION_MAJOR 5 #define LVGL_VERSION_MINOR 2 #define LVGL_VERSION_PATCH 0 -#define LVGL_VERSION_INFO "" +#define LVGL_VERSION_INFO "rc" /********************** * TYPEDEFS