From e71b32cf605f32ad292db58a2cbe587ef20ac68d Mon Sep 17 00:00:00 2001 From: Jee-Yong Um Date: Mon, 26 Oct 2015 01:27:02 +0100 Subject: [PATCH] hoversel: expands scrollable hoversel as large as it can Summary: In D2063, "max_size" data item is added to limit the number of items to show at a time when hoversel is expanded. However, it limits the number of items too few, so makes scrollable function useless. This patch removes limitation of hoversel size with pixels, but if it needs, developers can set the limitation yet. (By theme customization) Test Plan: elementary_test "hoversel" click the second hoversel Reviewers: DaveMDS, cedric Reviewed By: cedric Differential Revision: https://phab.enlightenment.org/D3223 Signed-off-by: Cedric BAIL --- legacy/elementary/data/themes/edc/elm/hover.edc | 8 ++++++-- legacy/elementary/src/bin/test_hoversel.c | 7 +++++++ legacy/elementary/src/lib/elc_hoversel.c | 6 ++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/legacy/elementary/data/themes/edc/elm/hover.edc b/legacy/elementary/data/themes/edc/elm/hover.edc index afed7088f1..7466f0d84c 100644 --- a/legacy/elementary/data/themes/edc/elm/hover.edc +++ b/legacy/elementary/data/themes/edc/elm/hover.edc @@ -442,7 +442,9 @@ group { name: "elm/hover/base/hoversel_vertical/default"; images.image: "button_normal.png" COMP; images.image: "vertical_separated_bar_glow.png" COMP; data.item: "dismiss" "on"; - data.item: "max_size" "60"; + // max_size limits the maximum size of expanded hoversel + // when it's scrollable. + //data.item: "max_size" "60"; parts { part { name: "elm.swallow.offset"; type: SWALLOW; description { state: "default" 0.0; @@ -666,7 +668,9 @@ group { name: "elm/hover/base/hoversel_horizontal/default"; alias: "elm/hover/base/hoversel_horizontal/entry"; images.image: "button_normal.png" COMP; data.item: "dismiss" "on"; - data.item: "max_size" "120"; + // max_size limits the maximum size of expanded hoversel + // when it's scrollable. + //data.item: "max_size" "120"; parts { part { name: "elm.swallow.offset"; type: SWALLOW; description { state: "default" 0.0; diff --git a/legacy/elementary/src/bin/test_hoversel.c b/legacy/elementary/src/bin/test_hoversel.c index 2979e02a64..72f7bad860 100644 --- a/legacy/elementary/src/bin/test_hoversel.c +++ b/legacy/elementary/src/bin/test_hoversel.c @@ -193,6 +193,13 @@ test_hoversel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ NULL); elm_hoversel_item_add(hoversel, "Item 5 - Long Label Here", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hoversel, "Item 6", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hoversel, "Item 7", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hoversel, "Item 8", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hoversel, "Item 9", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hoversel, "Item 10", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hoversel, "Item 11", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hoversel, "Item 12", NULL, ELM_ICON_NONE, NULL, NULL); elm_box_pack_end(bx, hoversel); evas_object_show(hoversel); diff --git a/legacy/elementary/src/lib/elc_hoversel.c b/legacy/elementary/src/lib/elc_hoversel.c index 4f827dca50..a922fbea5c 100644 --- a/legacy/elementary/src/lib/elc_hoversel.c +++ b/legacy/elementary/src/lib/elc_hoversel.c @@ -254,11 +254,10 @@ _resizing_eval(Evas_Object *obj, Elm_Hoversel_Data *sd) if (sd->horizontal) { - ww = MIN(box_w, max_size); + ww = (max_size > 0) ? MIN(box_w, max_size) : box_w ; hh = box_h; evas_object_size_hint_min_set(sd->spacer, ww, hh); - evas_object_size_hint_max_set(sd->spacer, max_size, -1); if (!sd->last_location) sd->last_location = elm_hover_best_content_location_get(sd->hover, ELM_HOVER_AXIS_HORIZONTAL); @@ -266,10 +265,9 @@ _resizing_eval(Evas_Object *obj, Elm_Hoversel_Data *sd) else { ww = box_w; - hh = MIN(box_h, max_size); + hh = (max_size > 0) ? MIN(box_h, max_size) : box_h ; evas_object_size_hint_min_set(sd->spacer, ww, hh); - evas_object_size_hint_max_set(sd->spacer, -1, max_size); if (!sd->last_location) sd->last_location = elm_hover_best_content_location_get(sd->hover, ELM_HOVER_AXIS_VERTICAL);