mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
Merge branch 'master' into dev-6.1
This commit is contained in:
commit
a611160636
12
README.md
12
README.md
@ -4,18 +4,6 @@
|
|||||||
<a href="https://github.com/littlevgl/lvgl/releases/tag/v6.0"><img src="https://img.shields.io/badge/version-6.0-blue.svg"></a>
|
<a href="https://github.com/littlevgl/lvgl/releases/tag/v6.0"><img src="https://img.shields.io/badge/version-6.0-blue.svg"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2 align="center">Shape the future of LittlevGL</h2>
|
|
||||||
|
|
||||||
<p align="center">
|
|
||||||
<a href="https://www.esurveycreator.com/s/littlevgl-2019"><img src="https://littlevgl.com/external/survey.png"></a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p align="center">
|
|
||||||
It takes only 5 minutes to tell some information about how you use LittlevGL, what you like about it, what should be improved and the future directions you find reasonable.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="https://littlevgl.com/github/cover_ori_reduced_2.gif">
|
<img src="https://littlevgl.com/github/cover_ori_reduced_2.gif">
|
||||||
</p>
|
</p>
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
/**********************
|
/**********************
|
||||||
* STATIC VARIABLES
|
* STATIC VARIABLES
|
||||||
**********************/
|
**********************/
|
||||||
static int16_t sin0_90_table[] = {
|
static const int16_t sin0_90_table[] = {
|
||||||
0, 572, 1144, 1715, 2286, 2856, 3425, 3993, 4560, 5126, 5690, 6252, 6813, 7371, 7927, 8481,
|
0, 572, 1144, 1715, 2286, 2856, 3425, 3993, 4560, 5126, 5690, 6252, 6813, 7371, 7927, 8481,
|
||||||
9032, 9580, 10126, 10668, 11207, 11743, 12275, 12803, 13328, 13848, 14364, 14876, 15383, 15886, 16383, 16876,
|
9032, 9580, 10126, 10668, 11207, 11743, 12275, 12803, 13328, 13848, 14364, 14876, 15383, 15886, 16383, 16876,
|
||||||
17364, 17846, 18323, 18794, 19260, 19720, 20173, 20621, 21062, 21497, 21925, 22347, 22762, 23170, 23571, 23964,
|
17364, 17846, 18323, 18794, 19260, 19720, 20173, 20621, 21062, 21497, 21925, 22347, 22762, 23170, 23571, 23964,
|
||||||
|
@ -863,7 +863,7 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
|
|||||||
for(area_below = ext->btn_id_pr; area_below < ext->btn_cnt; area_below++) {
|
for(area_below = ext->btn_id_pr; area_below < ext->btn_cnt; area_below++) {
|
||||||
if(ext->button_areas[area_below].y1 > ext->button_areas[ext->btn_id_pr].y1 &&
|
if(ext->button_areas[area_below].y1 > ext->button_areas[ext->btn_id_pr].y1 &&
|
||||||
pr_center >= ext->button_areas[area_below].x1 &&
|
pr_center >= ext->button_areas[area_below].x1 &&
|
||||||
pr_center <= ext->button_areas[area_below].x2 + style->body.padding.left) {
|
pr_center <= ext->button_areas[area_below].x2 + style->body.padding.inner) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -884,7 +884,7 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
|
|||||||
|
|
||||||
for(area_above = ext->btn_id_pr; area_above >= 0; area_above--) {
|
for(area_above = ext->btn_id_pr; area_above >= 0; area_above--) {
|
||||||
if(ext->button_areas[area_above].y1 < ext->button_areas[ext->btn_id_pr].y1 &&
|
if(ext->button_areas[area_above].y1 < ext->button_areas[ext->btn_id_pr].y1 &&
|
||||||
pr_center >= ext->button_areas[area_above].x1 - style->body.padding.left &&
|
pr_center >= ext->button_areas[area_above].x1 - style->body.padding.inner &&
|
||||||
pr_center <= ext->button_areas[area_above].x2) {
|
pr_center <= ext->button_areas[area_above].x2) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -47,11 +47,7 @@ static lv_signal_cb_t img_signal;
|
|||||||
static lv_signal_cb_t label_signal;
|
static lv_signal_cb_t label_signal;
|
||||||
static lv_signal_cb_t ancestor_page_signal;
|
static lv_signal_cb_t ancestor_page_signal;
|
||||||
static lv_signal_cb_t ancestor_btn_signal;
|
static lv_signal_cb_t ancestor_btn_signal;
|
||||||
#if LV_USE_GROUP
|
|
||||||
/*Used to make the last clicked button pressed (selected) when the list become focused and
|
|
||||||
* `click_focus == 1`*/
|
|
||||||
static lv_obj_t * last_clicked_btn;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
@ -94,6 +90,7 @@ lv_obj_t * lv_list_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
#if LV_USE_GROUP
|
#if LV_USE_GROUP
|
||||||
ext->last_sel = NULL;
|
ext->last_sel = NULL;
|
||||||
ext->selected_btn = NULL;
|
ext->selected_btn = NULL;
|
||||||
|
ext->last_clicked_btn = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lv_obj_set_signal_cb(new_list, lv_list_signal);
|
lv_obj_set_signal_cb(new_list, lv_list_signal);
|
||||||
@ -791,10 +788,12 @@ static lv_res_t lv_list_signal(lv_obj_t * list, lv_signal_t sign, void * param)
|
|||||||
/*Else select the clicked button*/
|
/*Else select the clicked button*/
|
||||||
else {
|
else {
|
||||||
/*Mark the last clicked button (if any) as selected because it triggered the focus*/
|
/*Mark the last clicked button (if any) as selected because it triggered the focus*/
|
||||||
if(last_clicked_btn) {
|
|
||||||
lv_list_set_btn_selected(list, last_clicked_btn);
|
|
||||||
} else {
|
|
||||||
lv_list_ext_t * ext = lv_obj_get_ext_attr(list);
|
lv_list_ext_t * ext = lv_obj_get_ext_attr(list);
|
||||||
|
if(ext->last_clicked_btn) {
|
||||||
|
lv_list_set_btn_selected(list, ext->last_clicked_btn);
|
||||||
|
ext->last_clicked_btn = NULL;
|
||||||
|
|
||||||
|
} else {
|
||||||
if(ext->last_sel) {
|
if(ext->last_sel) {
|
||||||
/* Select the last used button */
|
/* Select the last used button */
|
||||||
lv_list_set_btn_selected(list, ext->last_sel);
|
lv_list_set_btn_selected(list, ext->last_sel);
|
||||||
@ -810,8 +809,8 @@ static lv_res_t lv_list_signal(lv_obj_t * list, lv_signal_t sign, void * param)
|
|||||||
#if LV_USE_GROUP
|
#if LV_USE_GROUP
|
||||||
/*De-select the selected btn*/
|
/*De-select the selected btn*/
|
||||||
lv_list_set_btn_selected(list, NULL);
|
lv_list_set_btn_selected(list, NULL);
|
||||||
last_clicked_btn = NULL; /*button click will be set if click happens before focus*/
|
|
||||||
lv_list_ext_t * ext = lv_obj_get_ext_attr(list);
|
lv_list_ext_t * ext = lv_obj_get_ext_attr(list);
|
||||||
|
ext->last_clicked_btn = NULL; /*button click will be set if click happens before focus*/
|
||||||
ext->selected_btn = NULL;
|
ext->selected_btn = NULL;
|
||||||
#endif
|
#endif
|
||||||
} else if(sign == LV_SIGNAL_GET_EDITABLE) {
|
} else if(sign == LV_SIGNAL_GET_EDITABLE) {
|
||||||
@ -901,7 +900,7 @@ static lv_res_t lv_list_btn_signal(lv_obj_t * btn, lv_signal_t sign, void * para
|
|||||||
|
|
||||||
/* If `click_focus == 1` then LV_SIGNAL_FOCUS need to know which button triggered the focus
|
/* If `click_focus == 1` then LV_SIGNAL_FOCUS need to know which button triggered the focus
|
||||||
* to mark it as selected (pressed state)*/
|
* to mark it as selected (pressed state)*/
|
||||||
last_clicked_btn = btn;
|
ext->last_clicked_btn = btn;
|
||||||
#endif
|
#endif
|
||||||
if(lv_indev_is_dragging(lv_indev_get_act()) == false && ext->single_mode) {
|
if(lv_indev_is_dragging(lv_indev_get_act()) == false && ext->single_mode) {
|
||||||
lv_list_btn_single_select(btn);
|
lv_list_btn_single_select(btn);
|
||||||
|
@ -61,6 +61,9 @@ typedef struct
|
|||||||
#if LV_USE_GROUP
|
#if LV_USE_GROUP
|
||||||
lv_obj_t * last_sel; /* The last selected button. It will be reverted when the list is focused again */
|
lv_obj_t * last_sel; /* The last selected button. It will be reverted when the list is focused again */
|
||||||
lv_obj_t * selected_btn; /* The button is currently being selected*/
|
lv_obj_t * selected_btn; /* The button is currently being selected*/
|
||||||
|
/*Used to make the last clicked button pressed (selected) when the list become focused and
|
||||||
|
* `click_focus == 1`*/
|
||||||
|
lv_obj_t * last_clicked_btn;
|
||||||
#endif
|
#endif
|
||||||
} lv_list_ext_t;
|
} lv_list_ext_t;
|
||||||
|
|
||||||
|
@ -106,8 +106,8 @@ lv_obj_t * lv_table_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
ext->cell_style[1] = copy_ext->cell_style[1];
|
ext->cell_style[1] = copy_ext->cell_style[1];
|
||||||
ext->cell_style[2] = copy_ext->cell_style[2];
|
ext->cell_style[2] = copy_ext->cell_style[2];
|
||||||
ext->cell_style[3] = copy_ext->cell_style[3];
|
ext->cell_style[3] = copy_ext->cell_style[3];
|
||||||
ext->col_cnt = copy_ext->col_cnt;
|
lv_table_set_row_cnt(new_table, copy_ext->row_cnt);
|
||||||
ext->row_cnt = copy_ext->row_cnt;
|
lv_table_set_col_cnt(new_table, copy_ext->col_cnt);
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(new_table);
|
lv_obj_refresh_style(new_table);
|
||||||
|
@ -16,7 +16,7 @@ extern "C" {
|
|||||||
/*Current version of LittlevGL*/
|
/*Current version of LittlevGL*/
|
||||||
#define LVGL_VERSION_MAJOR 6
|
#define LVGL_VERSION_MAJOR 6
|
||||||
#define LVGL_VERSION_MINOR 0
|
#define LVGL_VERSION_MINOR 0
|
||||||
#define LVGL_VERSION_PATCH 0
|
#define LVGL_VERSION_PATCH 2
|
||||||
#define LVGL_VERSION_INFO ""
|
#define LVGL_VERSION_INFO ""
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user