From 38ec9b466a4da494c8bd4d7bd6b5ab54c42c4334 Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Wed, 16 Jan 2013 11:27:03 +0000 Subject: [PATCH] elementary/conformant - allocate dummy parts objects in conformant only when their swallow parts are actually exists. these conformant parts are not necessary in most cases since they are closely depenent on the platform feature. SVN revision: 82877 --- legacy/elementary/ChangeLog | 5 ++ legacy/elementary/NEWS | 2 + legacy/elementary/src/lib/elm_conform.c | 91 +++++++++++++++++-------- 3 files changed, 68 insertions(+), 30 deletions(-) diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index 629396894d..527e7da045 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -915,3 +915,8 @@ 2013-01-16 Jaeun Choi * Fix bug where index is not re-filled if autohide disabled + +2013-01-16 ChunEon Park (Hermet) + + * allocate conformant part dummy objects only when the swallow parts are existed actually. since these parts are really dependent on the platform, in most case they don't need all parts at the same time. + diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS index d5fd296e35..d62e7c6e5b 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/NEWS @@ -52,6 +52,8 @@ Improvements: * Setting the same font size of the others widgets for the dayselector. * Added a separated spinner for year on calendar. * Don't link anymore with E_DBus at build time. + * allocate conformant part dummy objects only when the swallow parts + are existed actually. since these parts are really dependent on the platform, in most case they don't need all parts at the same time. Fixes: diff --git a/legacy/elementary/src/lib/elm_conform.c b/legacy/elementary/src/lib/elm_conform.c index 4c1a13bbbc..940dd29fad 100644 --- a/legacy/elementary/src/lib/elm_conform.c +++ b/legacy/elementary/src/lib/elm_conform.c @@ -211,54 +211,78 @@ static void _conformant_parts_swallow(Evas_Object *obj) { Evas *e; + Elm_Widget_Smart_Data *wd; ELM_CONFORMANT_DATA_GET(obj, sd); + wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS); e = evas_object_evas_get(obj); sd->scroller = NULL; - //Indicator - //Indicator swallow can occur Only indicator show or rotation change - //Virtual Keyboard - if (!sd->virtualkeypad) + if (edje_object_part_exists(wd->resize_obj, "elm.swallow.virtualkeypad")) { - sd->virtualkeypad = evas_object_rectangle_add(e); - elm_widget_sub_object_add(obj, sd->virtualkeypad); - evas_object_size_hint_max_set(sd->virtualkeypad, -1, 0); - } - else - _conformant_part_sizing_eval(obj, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART); + if (!sd->virtualkeypad) + { + sd->virtualkeypad = evas_object_rectangle_add(e); + elm_widget_sub_object_add(obj, sd->virtualkeypad); + evas_object_size_hint_max_set(sd->virtualkeypad, -1, 0); + } + else + _conformant_part_sizing_eval(obj, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART); - evas_object_color_set(sd->virtualkeypad, 0, 0, 0, 0); - elm_layout_content_set(obj, "elm.swallow.virtualkeypad", sd->virtualkeypad); + evas_object_color_set(sd->virtualkeypad, 0, 0, 0, 0); + elm_layout_content_set(obj, "elm.swallow.virtualkeypad", + sd->virtualkeypad); + } + else if (sd->virtualkeypad) + { + evas_object_del(sd->virtualkeypad); + sd->virtualkeypad = NULL; + } //Clipboard - if (!sd->clipboard) + if (edje_object_part_exists(wd->resize_obj, "elm.swallow.clipboard")) { - sd->clipboard = evas_object_rectangle_add(e); - evas_object_size_hint_min_set(sd->clipboard, -1, 0); - evas_object_size_hint_max_set(sd->clipboard, -1, 0); - } - else - _conformant_part_sizing_eval(obj, ELM_CONFORMANT_CLIPBOARD_PART); + if (!sd->clipboard) + { + sd->clipboard = evas_object_rectangle_add(e); + evas_object_size_hint_min_set(sd->clipboard, -1, 0); + evas_object_size_hint_max_set(sd->clipboard, -1, 0); + } + else + _conformant_part_sizing_eval(obj, ELM_CONFORMANT_CLIPBOARD_PART); - evas_object_color_set(sd->clipboard, 0, 0, 0, 0); - elm_layout_content_set(obj, "elm.swallow.clipboard", sd->clipboard); + evas_object_color_set(sd->clipboard, 0, 0, 0, 0); + elm_layout_content_set(obj, "elm.swallow.clipboard", sd->clipboard); + } + else if (sd->clipboard) + { + evas_object_del(sd->clipboard); + sd->clipboard = NULL; + } //Softkey - if (!sd->softkey) + if (edje_object_part_exists(wd->resize_obj, "elm.swallow.softkey")) { - sd->softkey = evas_object_rectangle_add(e); - evas_object_size_hint_min_set(sd->softkey, -1, 0); - evas_object_size_hint_max_set(sd->softkey, -1, 0); - } - else - _conformant_part_sizing_eval(obj, ELM_CONFORMANT_SOFTKEY_PART); + if (!sd->softkey) + { + sd->softkey = evas_object_rectangle_add(e); + evas_object_size_hint_min_set(sd->softkey, -1, 0); + evas_object_size_hint_max_set(sd->softkey, -1, 0); + } + else + _conformant_part_sizing_eval(obj, ELM_CONFORMANT_SOFTKEY_PART); - evas_object_color_set(sd->softkey, 0, 0, 0, 0); - elm_layout_content_set(obj, "elm.swallow.softkey", sd->softkey); + evas_object_color_set(sd->softkey, 0, 0, 0, 0); + elm_layout_content_set(obj, "elm.swallow.softkey", sd->softkey); + } + else if (sd->softkey) + { + evas_object_del(sd->softkey); + sd->softkey = NULL; + } } static Eina_Bool @@ -424,9 +448,16 @@ static void _indicator_mode_set(Evas_Object *conformant, Elm_Win_Indicator_Mode indmode) { Evas_Object *old_indi = NULL; + Elm_Widget_Smart_Data *wd; + ELM_CONFORMANT_DATA_GET(conformant, sd); + wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS); + sd->indmode = indmode; + if (!edje_object_part_exists(wd->resize_obj, "elm.swallow.indicator")) + return; + if (indmode == ELM_WIN_INDICATOR_SHOW) { old_indi = elm_layout_content_get(conformant, "elm.swallow.indicator");