diff --git a/docs/conf.py b/docs/conf.py index 8a14efc7b..20b775892 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -114,7 +114,7 @@ html_theme_options = { 'logo_only': True, } # For site map generation -html_baseurl = 'https://docs.lvgl.io/master/en/html/' +html_baseurl = 'https://docs.lvgl.io/' + version + "/" sitemap_url_scheme = "{link}" # Add any paths that contain custom static files (such as style sheets) here, diff --git a/docs/index.md b/docs/index.md index 4b9d327c7..cca40368a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -19,7 +19,7 @@ PDF version: :download:`LVGL.pdf ` See how to port LVGL to any platform Learn the how LVGL works in more detail Take a look at the description of the available widgets - Be part of the development of LVGL + Be part of the development of LVGL diff --git a/examples/widgets/dropdown/lv_example_dropdown_3.c b/examples/widgets/dropdown/lv_example_dropdown_3.c index 6f7438247..f158a19b3 100644 --- a/examples/widgets/dropdown/lv_example_dropdown_3.c +++ b/examples/widgets/dropdown/lv_example_dropdown_3.c @@ -20,7 +20,7 @@ void lv_example_dropdown_3(void) lv_dropdown_set_options(dropdown, "New project\n" "New file\n" "Save\n" - "Save as\n" + "Save as ...\n" "Open project\n" "Recent projects\n" "Preferences\n" diff --git a/src/core/lv_obj.c b/src/core/lv_obj.c index e84ebaf16..00a425de4 100644 --- a/src/core/lv_obj.c +++ b/src/core/lv_obj.c @@ -728,7 +728,7 @@ static void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state) for(j = 0; tr->props[j] != 0 && tsi < STYLE_TRANSITION_MAX; j++) { uint32_t t; for(t = 0; t < tsi; t++) { - lv_style_selector_t selector = lv_obj_style_get_selector_state(ts[t].selector); + lv_style_selector_t selector = ts[t].selector; lv_state_t state_ts = lv_obj_style_get_selector_state(selector); lv_part_t part_ts = lv_obj_style_get_selector_part(selector); if(ts[t].prop == tr->props[j] && part_ts == part_act && state_ts >= state_act) break; @@ -756,11 +756,10 @@ static void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state) lv_mem_buf_release(ts); - if(cmp_res == _LV_STYLE_STATE_CMP_DIFF_REDRAW_MAIN) { + if(cmp_res == _LV_STYLE_STATE_CMP_DIFF_REDRAW) { lv_obj_invalidate(obj); } - - if(cmp_res == _LV_STYLE_STATE_CMP_DIFF_LAYOUT) { + else if(cmp_res == _LV_STYLE_STATE_CMP_DIFF_LAYOUT) { lv_obj_refresh_style(obj, LV_PART_ANY, LV_STYLE_PROP_ANY); } else if(cmp_res == _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD) { diff --git a/src/core/lv_obj_style.c b/src/core/lv_obj_style.c index 0870f8ce2..542d4c6af 100644 --- a/src/core/lv_obj_style.c +++ b/src/core/lv_obj_style.c @@ -365,27 +365,28 @@ _lv_style_state_cmp_t _lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t sta lv_style_t * style = obj->styles[i].style; lv_style_value_t v; /*If there is layout difference on the main part, return immediately. There is no more serious difference*/ - _lv_style_state_cmp_t res_tmp = res; - if(lv_style_get_prop(style, LV_STYLE_PAD_TOP, &v)) res_tmp = _LV_STYLE_STATE_CMP_DIFF_LAYOUT; - else if(lv_style_get_prop(style, LV_STYLE_PAD_BOTTOM, &v)) res_tmp = _LV_STYLE_STATE_CMP_DIFF_LAYOUT; - else if(lv_style_get_prop(style, LV_STYLE_PAD_LEFT, &v)) res_tmp = _LV_STYLE_STATE_CMP_DIFF_LAYOUT; - else if(lv_style_get_prop(style, LV_STYLE_PAD_RIGHT, &v)) res_tmp = _LV_STYLE_STATE_CMP_DIFF_LAYOUT; - else if(lv_style_get_prop(style, LV_STYLE_PAD_COLUMN, &v)) res_tmp = _LV_STYLE_STATE_CMP_DIFF_LAYOUT; - else if(lv_style_get_prop(style, LV_STYLE_PAD_ROW, &v)) res_tmp = _LV_STYLE_STATE_CMP_DIFF_LAYOUT; - else if(lv_style_get_prop(style, LV_STYLE_LAYOUT, &v)) res_tmp = _LV_STYLE_STATE_CMP_DIFF_LAYOUT; - else if(lv_style_get_prop(style, LV_STYLE_TRANSLATE_X, &v)) res_tmp = _LV_STYLE_STATE_CMP_DIFF_LAYOUT; - else if(lv_style_get_prop(style, LV_STYLE_TRANSLATE_Y, &v)) res_tmp = _LV_STYLE_STATE_CMP_DIFF_LAYOUT; - else if(lv_style_get_prop(style, LV_STYLE_WIDTH, &v)) res_tmp = _LV_STYLE_STATE_CMP_DIFF_LAYOUT; - else if(lv_style_get_prop(style, LV_STYLE_HEIGHT, &v)) res_tmp = _LV_STYLE_STATE_CMP_DIFF_LAYOUT; - else if(lv_style_get_prop(style, LV_STYLE_MIN_WIDTH, &v)) res_tmp = _LV_STYLE_STATE_CMP_DIFF_LAYOUT; - else if(lv_style_get_prop(style, LV_STYLE_MAX_WIDTH, &v)) res_tmp = _LV_STYLE_STATE_CMP_DIFF_LAYOUT; - else if(lv_style_get_prop(style, LV_STYLE_MIN_HEIGHT, &v)) res_tmp = _LV_STYLE_STATE_CMP_DIFF_LAYOUT; - else if(lv_style_get_prop(style, LV_STYLE_MAX_HEIGHT, &v)) res_tmp = _LV_STYLE_STATE_CMP_DIFF_LAYOUT; - else if(lv_style_get_prop(style, LV_STYLE_BORDER_WIDTH, &v)) res_tmp = _LV_STYLE_STATE_CMP_DIFF_LAYOUT; + bool layout_diff = false; + if(lv_style_get_prop(style, LV_STYLE_PAD_TOP, &v))layout_diff = true; + else if(lv_style_get_prop(style, LV_STYLE_PAD_BOTTOM, &v)) layout_diff = true; + else if(lv_style_get_prop(style, LV_STYLE_PAD_LEFT, &v)) layout_diff = true; + else if(lv_style_get_prop(style, LV_STYLE_PAD_RIGHT, &v)) layout_diff = true; + else if(lv_style_get_prop(style, LV_STYLE_PAD_COLUMN, &v)) layout_diff = true; + else if(lv_style_get_prop(style, LV_STYLE_PAD_ROW, &v)) layout_diff = true; + else if(lv_style_get_prop(style, LV_STYLE_LAYOUT, &v)) layout_diff = true; + else if(lv_style_get_prop(style, LV_STYLE_TRANSLATE_X, &v)) layout_diff = true; + else if(lv_style_get_prop(style, LV_STYLE_TRANSLATE_Y, &v)) layout_diff = true; + else if(lv_style_get_prop(style, LV_STYLE_WIDTH, &v)) layout_diff = true; + else if(lv_style_get_prop(style, LV_STYLE_HEIGHT, &v)) layout_diff = true; + else if(lv_style_get_prop(style, LV_STYLE_MIN_WIDTH, &v)) layout_diff = true; + else if(lv_style_get_prop(style, LV_STYLE_MAX_WIDTH, &v)) layout_diff = true; + else if(lv_style_get_prop(style, LV_STYLE_MIN_HEIGHT, &v)) layout_diff = true; + else if(lv_style_get_prop(style, LV_STYLE_MAX_HEIGHT, &v)) layout_diff = true; + else if(lv_style_get_prop(style, LV_STYLE_BORDER_WIDTH, &v)) layout_diff = true; - if(res_tmp == _LV_STYLE_STATE_CMP_DIFF_LAYOUT) { - if(part_act == LV_PART_MAIN) return _LV_STYLE_STATE_CMP_DIFF_LAYOUT; - else if(part_act == LV_PART_SCROLLBAR) return _LV_STYLE_STATE_CMP_DIFF_REDRAW_MAIN; + if(layout_diff) { + if(part_act == LV_PART_MAIN) { + return _LV_STYLE_STATE_CMP_DIFF_LAYOUT; + } else { res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; continue; @@ -406,15 +407,7 @@ _lv_style_state_cmp_t _lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t sta else if(lv_style_get_prop(style, LV_STYLE_SHADOW_OFS_Y, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; else if(lv_style_get_prop(style, LV_STYLE_SHADOW_SPREAD, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; else if(lv_style_get_prop(style, LV_STYLE_LINE_WIDTH, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; - else { - if(res != _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD) { - if((part_act == LV_PART_MAIN || part_act == LV_PART_SCROLLBAR)) { - res = _LV_STYLE_STATE_CMP_DIFF_REDRAW_MAIN; - } else if(res != _LV_STYLE_STATE_CMP_DIFF_REDRAW_MAIN) { - res = _LV_STYLE_STATE_CMP_DIFF_REDRAW_PART; - } - } - } + else if(res == _LV_STYLE_STATE_CMP_SAME) res = _LV_STYLE_STATE_CMP_DIFF_REDRAW; } } diff --git a/src/core/lv_obj_style.h b/src/core/lv_obj_style.h index e2d1dcf37..f6d30507e 100644 --- a/src/core/lv_obj_style.h +++ b/src/core/lv_obj_style.h @@ -29,8 +29,7 @@ struct _lv_obj_t; typedef enum { _LV_STYLE_STATE_CMP_SAME, /*The style properties in the 2 states are identical*/ - _LV_STYLE_STATE_CMP_DIFF_REDRAW_MAIN, /*The differences can be shown with a simple redraw*/ - _LV_STYLE_STATE_CMP_DIFF_REDRAW_PART, /*The differences can be shown with a simple redraw*/ + _LV_STYLE_STATE_CMP_DIFF_REDRAW, /*The differences can be shown with a simple redraw*/ _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD, /*The differences can be shown with a simple redraw*/ _LV_STYLE_STATE_CMP_DIFF_LAYOUT, /*The differences can be shown with a simple redraw*/ } _lv_style_state_cmp_t; diff --git a/src/extra/themes/default/lv_theme_default.c b/src/extra/themes/default/lv_theme_default.c index a0e834a52..056c8652b 100644 --- a/src/extra/themes/default/lv_theme_default.c +++ b/src/extra/themes/default/lv_theme_default.c @@ -813,10 +813,11 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj) lv_obj_add_style(obj, &styles->card, 0); lv_obj_add_style(obj, &styles->pad_small, 0); lv_obj_add_style(obj, &styles->transition_delayed, 0); - lv_obj_add_style(obj, &styles->pressed, LV_STATE_PRESSED); lv_obj_add_style(obj, &styles->transition_normal, LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->pressed, LV_STATE_PRESSED); lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &styles->transition_normal, LV_PART_INDICATOR); } else if(lv_obj_check_type(obj, &lv_dropdownlist_class)) { lv_obj_add_style(obj, &styles->card, 0);