hoversel: expands scrollable hoversel as large as it can
authorJee-Yong Um <jc9.um@samsung.com>
Mon, 26 Oct 2015 00:27:02 +0000 (01:27 +0100)
committerCedric BAIL <cedric@osg.samsung.com>
Mon, 26 Oct 2015 00:47:46 +0000 (01:47 +0100)
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 <cedric@osg.samsung.com>
data/themes/edc/elm/hover.edc
src/bin/test_hoversel.c
src/lib/elc_hoversel.c

index afed7088f15b054abf500c327a1c01eb295ce73a..7466f0d84cf61ce82bda464b3d0fa5a7ffa69d35 100644 (file)
@@ -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;
index 2979e02a64c80366a1e664efda400778d18bab88..72f7bad8606799dc7f1c0ac5249004392cc1e39d 100644 (file)
@@ -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);
 
index 4f827dca5068afbc59e841c15bd439223fca4cd1..a922fbea5c7a4d1e3da8da791ccc15a4dea6946b 100644 (file)
@@ -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);