summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJee-Yong Um <jc9.um@samsung.com>2015-10-26 01:27:02 +0100
committerNicolas Aguirre <aguirre.nicolas@gmail.com>2015-11-12 10:15:03 +0100
commitbbf6edd866ccf55edfb441eea510647b4eae04b3 (patch)
treed4903702368e87a4c2f2213f513777203876712e
parent3a44e70abc50c902cd95976208a7e77b3cd3b0c7 (diff)
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 <cedric@osg.samsung.com>
-rw-r--r--data/themes/edc/elm/hover.edc8
-rw-r--r--src/bin/test_hoversel.c7
-rw-r--r--src/lib/elc_hoversel.c6
3 files changed, 15 insertions, 6 deletions
diff --git a/data/themes/edc/elm/hover.edc b/data/themes/edc/elm/hover.edc
index afed7088f..7466f0d84 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";
442 images.image: "button_normal.png" COMP; 442 images.image: "button_normal.png" COMP;
443 images.image: "vertical_separated_bar_glow.png" COMP; 443 images.image: "vertical_separated_bar_glow.png" COMP;
444 data.item: "dismiss" "on"; 444 data.item: "dismiss" "on";
445 data.item: "max_size" "60"; 445 // max_size limits the maximum size of expanded hoversel
446 // when it's scrollable.
447 //data.item: "max_size" "60";
446 parts { 448 parts {
447 part { name: "elm.swallow.offset"; type: SWALLOW; 449 part { name: "elm.swallow.offset"; type: SWALLOW;
448 description { state: "default" 0.0; 450 description { state: "default" 0.0;
@@ -666,7 +668,9 @@ group { name: "elm/hover/base/hoversel_horizontal/default";
666 alias: "elm/hover/base/hoversel_horizontal/entry"; 668 alias: "elm/hover/base/hoversel_horizontal/entry";
667 images.image: "button_normal.png" COMP; 669 images.image: "button_normal.png" COMP;
668 data.item: "dismiss" "on"; 670 data.item: "dismiss" "on";
669 data.item: "max_size" "120"; 671 // max_size limits the maximum size of expanded hoversel
672 // when it's scrollable.
673 //data.item: "max_size" "120";
670 parts { 674 parts {
671 part { name: "elm.swallow.offset"; type: SWALLOW; 675 part { name: "elm.swallow.offset"; type: SWALLOW;
672 description { state: "default" 0.0; 676 description { state: "default" 0.0;
diff --git a/src/bin/test_hoversel.c b/src/bin/test_hoversel.c
index 2979e02a6..72f7bad86 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_
193 NULL); 193 NULL);
194 elm_hoversel_item_add(hoversel, "Item 5 - Long Label Here", NULL, ELM_ICON_NONE, NULL, 194 elm_hoversel_item_add(hoversel, "Item 5 - Long Label Here", NULL, ELM_ICON_NONE, NULL,
195 NULL); 195 NULL);
196 elm_hoversel_item_add(hoversel, "Item 6", NULL, ELM_ICON_NONE, NULL, NULL);
197 elm_hoversel_item_add(hoversel, "Item 7", NULL, ELM_ICON_NONE, NULL, NULL);
198 elm_hoversel_item_add(hoversel, "Item 8", NULL, ELM_ICON_NONE, NULL, NULL);
199 elm_hoversel_item_add(hoversel, "Item 9", NULL, ELM_ICON_NONE, NULL, NULL);
200 elm_hoversel_item_add(hoversel, "Item 10", NULL, ELM_ICON_NONE, NULL, NULL);
201 elm_hoversel_item_add(hoversel, "Item 11", NULL, ELM_ICON_NONE, NULL, NULL);
202 elm_hoversel_item_add(hoversel, "Item 12", NULL, ELM_ICON_NONE, NULL, NULL);
196 elm_box_pack_end(bx, hoversel); 203 elm_box_pack_end(bx, hoversel);
197 evas_object_show(hoversel); 204 evas_object_show(hoversel);
198 205
diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c
index 4f827dca5..a922fbea5 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)
254 254
255 if (sd->horizontal) 255 if (sd->horizontal)
256 { 256 {
257 ww = MIN(box_w, max_size); 257 ww = (max_size > 0) ? MIN(box_w, max_size) : box_w ;
258 hh = box_h; 258 hh = box_h;
259 259
260 evas_object_size_hint_min_set(sd->spacer, ww, hh); 260 evas_object_size_hint_min_set(sd->spacer, ww, hh);
261 evas_object_size_hint_max_set(sd->spacer, max_size, -1);
262 261
263 if (!sd->last_location) 262 if (!sd->last_location)
264 sd->last_location = elm_hover_best_content_location_get(sd->hover, ELM_HOVER_AXIS_HORIZONTAL); 263 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)
266 else 265 else
267 { 266 {
268 ww = box_w; 267 ww = box_w;
269 hh = MIN(box_h, max_size); 268 hh = (max_size > 0) ? MIN(box_h, max_size) : box_h ;
270 269
271 evas_object_size_hint_min_set(sd->spacer, ww, hh); 270 evas_object_size_hint_min_set(sd->spacer, ww, hh);
272 evas_object_size_hint_max_set(sd->spacer, -1, max_size);
273 271
274 if (!sd->last_location) 272 if (!sd->last_location)
275 sd->last_location = elm_hover_best_content_location_get(sd->hover, ELM_HOVER_AXIS_VERTICAL); 273 sd->last_location = elm_hover_best_content_location_get(sd->hover, ELM_HOVER_AXIS_VERTICAL);