From: Carsten Haitzler Date: Thu, 15 Jan 2009 11:34:39 +0000 (+0000) Subject: fix list slowness with edje complaints on min size. also handle sizing icons X-Git-Tag: v1.0.0~5509 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=90473f0b23d716234c8b36843365b850ee0cbf86;p=platform%2Fupstream%2Felementary.git fix list slowness with edje complaints on min size. also handle sizing icons down when icon allowed to down-scale. SVN revision: 38593 --- diff --git a/data/themes/default.edc b/data/themes/default.edc index 1324c90..e3b0951 100644 --- a/data/themes/default.edc +++ b/data/themes/default.edc @@ -4817,6 +4817,7 @@ collections { state: "default" 0.0; align: 0.0 0.0; min: 0 10; + fixed: 1 1; rel1 { to: "base"; relative: 0.0 1.0; diff --git a/src/bin/test.c b/src/bin/test.c index 30a1b7e..dac9a9a 100644 --- a/src/bin/test.c +++ b/src/bin/test.c @@ -1751,6 +1751,25 @@ my_bt_22(void *data, Evas_Object *obj, void *event_info) } static void +my_bt_23(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *win, *bg; + char buf[PATH_MAX]; + + win = elm_win_add(NULL, "carousel", ELM_WIN_BASIC); + elm_win_title_set(win, "Carousel"); + elm_win_autodel_set(win, 1); + + bg = elm_bg_add(win); + elm_win_resize_object_add(win, bg); + evas_object_size_hint_weight_set(bg, 1.0, 1.0); + evas_object_show(bg); + + evas_object_resize(win, 320, 240); + evas_object_show(win); +} + +static void my_win_main(void) { Evas_Object *win, *bg, *bx0, *lb, *bx, *bt, *sc, *fr; @@ -1997,6 +2016,13 @@ my_win_main(void) elm_box_pack_end(bx, bt); evas_object_show(bt); + bt = elm_button_add(win); + elm_button_label_set(bt, "Carousel"); + evas_object_smart_callback_add(bt, "clicked", my_bt_23, NULL); + evas_object_size_hint_align_set(bt, -1.0, 0.0); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + /* set an initial window size */ evas_object_resize(win, 320, 520); /* show the window */ diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 123e8d0..b6c5ac2 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -487,6 +487,7 @@ extern "C" { // * file selector widget // //// (improvements - low priority) +// * need a way to set a preferred size of a widget (but not min or max). // * merge with gurana // * use evas's new box instead of a box smart // * use evas's table instead of a table smart diff --git a/src/lib/elm_carousel.c b/src/lib/elm_carousel.c index 02af673..5256fb3 100644 --- a/src/lib/elm_carousel.c +++ b/src/lib/elm_carousel.c @@ -11,7 +11,6 @@ struct _Widget_Data Evas_Object *scr, *bx; Eina_List *items; int icon_size; - Evas_Bool scrollable : 1; }; struct _Item @@ -113,16 +112,8 @@ _sizing_eval(Evas_Object *obj) evas_object_size_hint_min_get(wd->bx, &minw, &minh); evas_object_resize(wd->bx, minw, minh); elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh); - if (wd->scrollable) - { - minw = 500 - vw; - minh = minh + (500 - vh); - } - else - { - minw = minw + (500 - vw); - minh = minh + (500 - vh); - } + minw = minw + (500 - vw); + minh = minh + (500 - vh); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, maxw, maxh); } @@ -183,7 +174,6 @@ elm_carousel_add(Evas_Object *parent) ELM_SMART_SCROLLER_POLICY_OFF); wd->icon_size = 32; - wd->scrollable = 1; wd->bx = _els_smart_box_add(e); _els_smart_box_orientation_set(wd->bx, 1); diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c index 62ef282..8ff38fb 100644 --- a/src/lib/elm_list.c +++ b/src/lib/elm_list.c @@ -256,11 +256,13 @@ _fix_items(Evas_Object *obj) } if (it->icon) { + edje_extern_object_aspect_set(it->icon, EDJE_ASPECT_CONTROL_VERTICAL, minw[0], minh[0]); edje_extern_object_min_size_set(it->icon, minw[0], minh[0]); edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon); } if (it->end) { + edje_extern_object_aspect_set(it->end, EDJE_ASPECT_CONTROL_VERTICAL, minw[1], minh[1]); edje_extern_object_min_size_set(it->end, minw[1], minh[1]); edje_object_part_swallow(it->base, "elm.swallow.end", it->end); }