minor fixes for better encoder support

This commit is contained in:
Gabor Kiss-Vamosi
2018-09-23 23:27:28 +02:00
parent 0835e0584a
commit 36369325e7
8 changed files with 80 additions and 13 deletions

View File

@@ -394,7 +394,7 @@ lv_group_focus_cb_t lv_group_get_focus_cb(const lv_group_t * group)
* @param group pointer to group
* @return true editing is enabled
*/
bool lv_group_get_edit_enable(const lv_group_t * group, bool en)
bool lv_group_get_edit_enable(const lv_group_t * group)
{
return group->edit_mode_en ? true : false;
}

View File

@@ -208,7 +208,7 @@ lv_group_focus_cb_t lv_group_get_focus_cb(const lv_group_t * group);
* @param group pointer to group
* @return true editing is enabled
*/
bool lv_group_get_edit_enable(const lv_group_t * group, bool en);
bool lv_group_get_edit_enable(const lv_group_t * group);
/**
* Get the current mode (edit or navigate).

View File

@@ -366,13 +366,14 @@ static void indev_keypad_proc(lv_indev_t * i, lv_indev_data_t * data)
i->proc.long_pr_sent == 0 &&
lv_tick_elaps(i->proc.pr_timestamp) > LV_INDEV_LONG_PRESS_TIME )
{
/*If edit mode is enabled and the focused obejct is editable then change between edit and navigate on long press*/
/*If edit mode is enabled and the focused obeject is editable then change between edit and navigate on long press*/
lv_obj_t * focused = lv_group_get_focused(i->group);
bool editable = false;
focused->signal_func(focused, LV_SIGNAL_GET_EDITABLE, &editable);
if (i->group->edit_mode_en && editable) {
i->group->editing = i->group->editing ? 0 : 1;
focused->signal_func(focused, LV_SIGNAL_FOCUS, NULL); /*Focus again. Some object do something on navigate->edit change*/
LV_LOG_INFO("Edit mode changed");
if(focused) lv_obj_invalidate(focused);
}