elementary/conformant - allocate dummy parts objects in conformant only when their...
authorChunEon Park <hermet@hermet.pe.kr>
Wed, 16 Jan 2013 11:27:03 +0000 (11:27 +0000)
committerChunEon Park <hermet@hermet.pe.kr>
Wed, 16 Jan 2013 11:27:03 +0000 (11:27 +0000)
SVN revision: 82877

legacy/elementary/ChangeLog
legacy/elementary/NEWS
legacy/elementary/src/lib/elm_conform.c

index 6293968..527e7da 100644 (file)
 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.
+
index d5fd296..d62e7c6 100644 (file)
@@ -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:
 
index 4c1a13b..940dd29 100644 (file)
@@ -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");