From afb4a194a82a092cb1568924c36d9b186007a28e Mon Sep 17 00:00:00 2001 From: "godly.talias" Date: Mon, 30 May 2016 14:39:36 +0900 Subject: Added feature to bring focused item to viewport on click Summary: Currently when an item in gengrid is focused and if it is scrolled off the viewport halfly and if it user clicks on it, it won't be scrolled into viewport. Only non-focused items will be scrolled into viewport when clicked. Test Plan: elementary_test -> Gengrid focus -> Click an item -> Scroll it little bit out of viewport -> Click again Reviewers: prince.dubey, shilpasingh, cedric, raster, SanghyeonLee Subscribers: seoz, rajeshps, govi, jpeg Differential Revision: https://phab.enlightenment.org/D3977 --- src/lib/elementary/elm_gengrid.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/lib/elementary/elm_gengrid.c') diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c index be9888a89b..0f73473b52 100644 --- a/src/lib/elementary/elm_gengrid.c +++ b/src/lib/elementary/elm_gengrid.c @@ -1108,6 +1108,22 @@ _item_mouse_up_cb(void *data, if ((ev->flags == EVAS_BUTTON_NONE) && (sd->focused_item != eo_it)) elm_object_item_focus_set(eo_it, EINA_TRUE); + else if (ev->flags == EVAS_BUTTON_NONE) + { + switch (_elm_config->focus_autoscroll_mode) + { + case ELM_FOCUS_AUTOSCROLL_MODE_SHOW: + elm_gengrid_item_show + (eo_it, ELM_GENGRID_ITEM_SCROLLTO_IN); + break; + case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN: + elm_gengrid_item_bring_in + (eo_it, ELM_GENGRID_ITEM_SCROLLTO_IN); + break; + default: + break; + } + } if (sd->multi && ((sd->multi_select_mode != ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL) || -- cgit v1.2.1