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>
This commit is contained in:
Jee-Yong Um 2015-10-26 01:27:02 +01:00 committed by Cedric BAIL
parent 859e9a91ce
commit e71b32cf60
3 changed files with 15 additions and 6 deletions

View 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;

View 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);

View 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);