Lines Matching refs:focused_obj
25 lv_obj_t * focused_obj; member
69 dsc->focused_obj = NULL; in lv_gridnav_add()
98 lv_obj_clear_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); in lv_gridnav_set_focused()
101 dsc->focused_obj = to_focus; in lv_gridnav_set_focused()
119 if(dsc->focused_obj == NULL) dsc->focused_obj = find_first_focusable(obj); in gridnav_event_cb()
120 if(dsc->focused_obj == NULL) return; in gridnav_event_cb()
126 …if((dsc->ctrl & LV_GRIDNAV_CTRL_SCROLL_FIRST) && lv_obj_has_flag(dsc->focused_obj, LV_OBJ_FLAG_SCR… in gridnav_event_cb()
127 lv_obj_get_scroll_right(dsc->focused_obj) > 0) { in gridnav_event_cb()
128 lv_coord_t d = lv_obj_get_width(dsc->focused_obj) / 4; in gridnav_event_cb()
130 lv_obj_scroll_by_bounded(dsc->focused_obj, -d, 0, LV_ANIM_ON); in gridnav_event_cb()
133 guess = find_chid(obj, dsc->focused_obj, FIND_RIGHT); in gridnav_event_cb()
136 guess = find_chid(obj, dsc->focused_obj, FIND_NEXT_ROW_FIRST_ITEM); in gridnav_event_cb()
146 …if((dsc->ctrl & LV_GRIDNAV_CTRL_SCROLL_FIRST) && lv_obj_has_flag(dsc->focused_obj, LV_OBJ_FLAG_SCR… in gridnav_event_cb()
147 lv_obj_get_scroll_left(dsc->focused_obj) > 0) { in gridnav_event_cb()
148 lv_coord_t d = lv_obj_get_width(dsc->focused_obj) / 4; in gridnav_event_cb()
150 lv_obj_scroll_by_bounded(dsc->focused_obj, d, 0, LV_ANIM_ON); in gridnav_event_cb()
153 guess = find_chid(obj, dsc->focused_obj, FIND_LEFT); in gridnav_event_cb()
156 guess = find_chid(obj, dsc->focused_obj, FIND_PREV_ROW_LAST_ITEM); in gridnav_event_cb()
166 …if((dsc->ctrl & LV_GRIDNAV_CTRL_SCROLL_FIRST) && lv_obj_has_flag(dsc->focused_obj, LV_OBJ_FLAG_SCR… in gridnav_event_cb()
167 lv_obj_get_scroll_bottom(dsc->focused_obj) > 0) { in gridnav_event_cb()
168 lv_coord_t d = lv_obj_get_height(dsc->focused_obj) / 4; in gridnav_event_cb()
170 lv_obj_scroll_by_bounded(dsc->focused_obj, 0, -d, LV_ANIM_ON); in gridnav_event_cb()
173 guess = find_chid(obj, dsc->focused_obj, FIND_BOTTOM); in gridnav_event_cb()
176 guess = find_chid(obj, dsc->focused_obj, FIND_FIRST_ROW); in gridnav_event_cb()
185 …if((dsc->ctrl & LV_GRIDNAV_CTRL_SCROLL_FIRST) && lv_obj_has_flag(dsc->focused_obj, LV_OBJ_FLAG_SCR… in gridnav_event_cb()
186 lv_obj_get_scroll_top(dsc->focused_obj) > 0) { in gridnav_event_cb()
187 lv_coord_t d = lv_obj_get_height(dsc->focused_obj) / 4; in gridnav_event_cb()
189 lv_obj_scroll_by_bounded(dsc->focused_obj, 0, d, LV_ANIM_ON); in gridnav_event_cb()
192 guess = find_chid(obj, dsc->focused_obj, FIND_TOP); in gridnav_event_cb()
195 guess = find_chid(obj, dsc->focused_obj, FIND_LAST_ROW); in gridnav_event_cb()
205 lv_event_send(dsc->focused_obj, LV_EVENT_KEY, &key); in gridnav_event_cb()
209 if(guess && guess != dsc->focused_obj) { in gridnav_event_cb()
210 lv_obj_clear_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); in gridnav_event_cb()
213 dsc->focused_obj = guess; in gridnav_event_cb()
217 if(dsc->focused_obj == NULL) dsc->focused_obj = find_first_focusable(obj); in gridnav_event_cb()
218 if(dsc->focused_obj) { in gridnav_event_cb()
219 lv_obj_add_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); in gridnav_event_cb()
220 …lv_obj_clear_state(dsc->focused_obj, LV_STATE_PRESSED); /*Be sure the focuses obj is not stuck in … in gridnav_event_cb()
221 lv_obj_scroll_to_view(dsc->focused_obj, LV_ANIM_OFF); in gridnav_event_cb()
225 if(dsc->focused_obj) { in gridnav_event_cb()
226 lv_obj_clear_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); in gridnav_event_cb()
232 if(dsc->focused_obj == NULL) { in gridnav_event_cb()
233 dsc->focused_obj = child; in gridnav_event_cb()
247 dsc->focused_obj = find_first_focusable(obj); in gridnav_event_cb()
260 lv_event_send(dsc->focused_obj, code, lv_indev_get_act()); in gridnav_event_cb()