mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
Merge branch 'dev-6.0' into padding
This commit is contained in:
commit
abf8cbfb92
@ -14,14 +14,24 @@ But first, start with the most Frequently Asked Questions.
|
||||
|
||||
## FAQ about contributing
|
||||
|
||||
### Where can I write my question and remarks?
|
||||
### What license does my code need to be under?
|
||||
|
||||
We use [GitHub's issue tracker](https://github.com/littlevgl/lvgl/issues) to ask questions., report bugs and suggest features. But there are some simple rules:
|
||||
Any code added to LittlevGL must be licensed under [MIT](https://choosealicense.com/licenses/mit/) or another license that is fully compatible. Contributions under other licenses are highly likely to be rejected.
|
||||
|
||||
If you borrow code from another project, please make sure to add their copyright notice to your contribution.
|
||||
|
||||
### Where do I ask questions, give feedback, or report bugs?
|
||||
|
||||
We use the [forum](http://forum.littlevgl.com/) for questions, feature suggestions, and discussions.
|
||||
|
||||
We use [GitHub's issue tracker](https://github.com/littlevgl/lvgl/issues) to report bugs.
|
||||
|
||||
For both of these there are some rules:
|
||||
- Be kind and friendly.
|
||||
- Speak about one thing in one issue.
|
||||
- Give feedback and close the issue if your question is answered.
|
||||
- Tell what you experience or expect. _"The button is not working"_ is not enough info to get help.
|
||||
- If possible send an absolute minimal code example in order to reproduce the issue
|
||||
- Explain exactly what you experience or expect. _"The button is not working"_ is not enough info to get help.
|
||||
- For most issues you should send an absolute minimal code example in order to reproduce the issue. Ideally this should be easily usable in the PC simulator.
|
||||
- Use [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) to format your post.
|
||||
- If you don't get any answer in a week write a comment like "Can somebody help?". Maybe your issue wasn't noticed.
|
||||
|
||||
@ -30,7 +40,7 @@ Merging new code happens via Pull Requests. If you are still not familiar with t
|
||||
1. **Fork** the [lvgl repository](https://github.com/littlevgl/lvgl). To do this click the "Fork" button in the top right corner. It will "copy" the `lvgl` repository to your GitHub account (`https://github.com/your_name?tab=repositories`)
|
||||
2. **Clone** the forked repository and add your updates
|
||||
3. **Create a PR** on the GitHub on the page of you `lvgl` repository(`https://github.com/your_name/lvgl`) by hitting the "New pull request" button
|
||||
4. **Set the base branch**. It means where you want to merge your update. Fixes go to `master`, new features to the actual `dev-x.y` branch.
|
||||
4. **Set the base branch**. It means where you want to merge your update. Bugfixes for the last release go to `master`, new features to the actual `dev-x.y` branch.
|
||||
5. **Describe** what is in the update. An example code is welcome if applicable.
|
||||
|
||||
Some advice:
|
||||
|
@ -185,7 +185,7 @@ void lv_ddlist_set_selected(lv_obj_t * ddlist, uint16_t sel_opt)
|
||||
if(ext->sel_opt_id == sel_opt) return;
|
||||
|
||||
ext->sel_opt_id = sel_opt < ext->option_cnt ? sel_opt : ext->option_cnt - 1;
|
||||
|
||||
ext->sel_opt_id_ori = ext->sel_opt_id;
|
||||
/*Move the list to show the current option*/
|
||||
if(ext->opened == 0) {
|
||||
lv_ddlist_pos_current_option(ddlist);
|
||||
|
@ -25,7 +25,7 @@
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static lv_res_t lv_kb_signal(lv_obj_t * kb, lv_signal_t sign, void * param);
|
||||
static void lv_kb_def_event_cb(lv_obj_t * kb);
|
||||
static void lv_kb_def_btn_action_cb(lv_obj_t * kb);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
@ -368,11 +368,11 @@ static lv_res_t lv_kb_signal(lv_obj_t * kb, lv_signal_t sign, void * param)
|
||||
/*Nothing to cleanup. (No dynamically allocated memory in 'ext')*/
|
||||
}
|
||||
else if(sign == LV_SIGNAL_PRESSED) {
|
||||
lv_kb_def_event_cb(kb);
|
||||
lv_kb_def_btn_action_cb(kb);
|
||||
}
|
||||
else if(sign == LV_SIGNAL_LONG_PRESS_REP) {
|
||||
bool no_rep = lv_btnm_get_btn_no_repeate(kb, lv_btnm_get_active_btn(kb));
|
||||
if(no_rep == false) lv_kb_def_event_cb(kb);
|
||||
if(no_rep == false) lv_kb_def_btn_action_cb(kb);
|
||||
}
|
||||
else if(sign == LV_SIGNAL_FOCUS) {
|
||||
lv_kb_ext_t * ext = lv_obj_get_ext_attr(kb);
|
||||
@ -402,12 +402,12 @@ static lv_res_t lv_kb_signal(lv_obj_t * kb, lv_signal_t sign, void * param)
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when a button of the keyboard is released
|
||||
* Called when a button of the keyboard is pressed or long pressed to change map or add the button's test to the assigned Text area.
|
||||
* @param kb pointer to a keyboard
|
||||
* @param event type of the event
|
||||
*/
|
||||
static void lv_kb_def_event_cb(lv_obj_t * kb)
|
||||
static void lv_kb_def_btn_action_cb(lv_obj_t * kb)
|
||||
{
|
||||
lv_kb_ext_t * ext = lv_obj_get_ext_attr(kb);
|
||||
|
||||
|
@ -78,7 +78,6 @@ lv_obj_t * lv_tileview_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
|
||||
/*Initialize the allocated 'ext' */
|
||||
ext->anim_time = LV_TILEVIEW_ANIM_TIME;
|
||||
ext->action = NULL;
|
||||
ext->act_id.x = 0;
|
||||
ext->act_id.y = 0;
|
||||
ext->valid_pos = NULL;
|
||||
@ -109,7 +108,6 @@ lv_obj_t * lv_tileview_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
lv_tileview_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
|
||||
ext->act_id.x = copy_ext->act_id.x;
|
||||
ext->act_id.y = copy_ext->act_id.y;
|
||||
ext->action = copy_ext->action;
|
||||
ext->anim_time = copy_ext->anim_time;
|
||||
|
||||
|
||||
@ -128,14 +126,22 @@ lv_obj_t * lv_tileview_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
|
||||
/**
|
||||
* Register an object on the tileview. The register object will able to slide the tileview
|
||||
* @param tileview pointer to a Tileview object
|
||||
* @param element pointer to an object
|
||||
*/
|
||||
void lv_tileview_add_element(lv_obj_t * element)
|
||||
void lv_tileview_add_element(lv_obj_t * tileview, lv_obj_t * element)
|
||||
{
|
||||
/* Let objects eventto propaget to the scrollable part of the tileview.
|
||||
/* Let the objects event to propagate to the scrollable part of the tileview.
|
||||
* It is required the handle dargging of the tileview with the element.*/
|
||||
element->parent_event = 1;
|
||||
lv_obj_set_drag_parent(element, true);
|
||||
|
||||
/* When adding a new element the coordinates may shift.
|
||||
* For example y=1 can become y=1 if an element is added to the top.
|
||||
* So be sure the current tile is correctly shown*/
|
||||
lv_tileview_ext_t * ext = lv_obj_get_ext_attr(tileview);
|
||||
lv_tileview_set_tile_act(tileview, ext->act_id.x, ext->act_id.y, false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -153,6 +159,20 @@ void lv_tileview_set_valid_positions(lv_obj_t * tileview, const lv_point_t * val
|
||||
{
|
||||
lv_tileview_ext_t * ext = lv_obj_get_ext_attr(tileview);
|
||||
ext->valid_pos = valid_pos;
|
||||
|
||||
|
||||
/*If valid pos. is selected do nothing*/
|
||||
uint16_t i;
|
||||
for(i = 0; valid_pos[i].x != LV_COORD_MIN; i++) {
|
||||
if(valid_pos->x == ext->act_id.x && valid_pos->y == ext->act_id.y) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*Set a valid position if now an invalid is selected*/
|
||||
if(valid_pos->x != LV_COORD_MIN && valid_pos->y != LV_COORD_MIN) {
|
||||
lv_tileview_set_tile_act(tileview, valid_pos->x, valid_pos->y, false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -181,10 +201,6 @@ void lv_tileview_set_tile_act(lv_obj_t * tileview, lv_coord_t x, lv_coord_t y, b
|
||||
|
||||
if(valid == false) return; /*Don't load not valid tiles*/
|
||||
|
||||
lv_res_t res = LV_RES_OK;
|
||||
if(ext->action) res = ext->action(tileview, x, y);
|
||||
if(res != LV_RES_OK) return; /*Prevent the tile loading*/
|
||||
|
||||
ext->act_id.x = x;
|
||||
ext->act_id.y = y;
|
||||
|
||||
@ -222,15 +238,13 @@ void lv_tileview_set_tile_act(lv_obj_t * tileview, lv_coord_t x, lv_coord_t y, b
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
lv_obj_set_size(tileview, x_coord, y_coord);
|
||||
lv_obj_set_pos(scrl, x_coord, y_coord);
|
||||
}
|
||||
}
|
||||
|
||||
void lv_tileview_set_tile_load_action(lv_obj_t * tileview, lv_tileview_action_t action)
|
||||
{
|
||||
lv_tileview_ext_t * ext = lv_obj_get_ext_attr(tileview);
|
||||
ext->action = action;
|
||||
|
||||
lv_res_t res = LV_RES_OK;
|
||||
res = lv_obj_send_event(tileview, LV_EVENT_VALUE_CHANGED);
|
||||
if(res != LV_RES_OK) return; /*Prevent the tile loading*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -44,7 +44,6 @@ typedef struct {
|
||||
/*New data for this type */
|
||||
const lv_point_t * valid_pos;
|
||||
uint16_t anim_time;
|
||||
lv_tileview_action_t action;
|
||||
lv_point_t act_id;
|
||||
uint8_t drag_top_en :1;
|
||||
uint8_t drag_bottom_en :1;
|
||||
@ -80,9 +79,10 @@ lv_obj_t * lv_tileview_create(lv_obj_t * par, const lv_obj_t * copy);
|
||||
|
||||
/**
|
||||
* Register an object on the tileview. The register object will able to slide the tileview
|
||||
* @param tileview pointer to a Tileview object
|
||||
* @param element pointer to an object
|
||||
*/
|
||||
void lv_tileview_add_element(lv_obj_t * element);
|
||||
void lv_tileview_add_element(lv_obj_t * tileview, lv_obj_t * element);
|
||||
|
||||
/*=====================
|
||||
* Setter functions
|
||||
|
Loading…
x
Reference in New Issue
Block a user