cedric pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=7e1d1d19e9398225f1d546b20fc6d7c2998b0abc

commit 7e1d1d19e9398225f1d546b20fc6d7c2998b0abc
Author: Jee-Yong Um <jc9...@samsung.com>
Date:   Mon Oct 26 01:27:02 2015 +0100

    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 <ced...@osg.samsung.com>
---
 data/themes/edc/elm/hover.edc | 8 ++++++--
 src/bin/test_hoversel.c       | 7 +++++++
 src/lib/elc_hoversel.c        | 6 ++----
 3 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/data/themes/edc/elm/hover.edc b/data/themes/edc/elm/hover.edc
index afed708..7466f0d 100644
--- a/data/themes/edc/elm/hover.edc
+++ b/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/src/bin/test_hoversel.c b/src/bin/test_hoversel.c
index 2979e02..72f7bad 100644
--- a/src/bin/test_hoversel.c
+++ b/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/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c
index 4f827dc..a922fbe 100644
--- a/src/lib/elc_hoversel.c
+++ b/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);

-- 


Reply via email to