Dear all,
I'm Sohyun Kim. Nice to meet you.

This is a patch for bubble theme.

The bubble has a region for icon, label and info text. 
However, it has the region, if icon, label and info text are not set.
I modified theme and added edje signals.

1. add edje signal for label and info text state
2. remove text size for label and info text default state
   -> set it on "visible" state
3. add base image state for info text only

If this patch has any issue, please let me know.

Regards,

Index: src/lib/elm_bubble.c
===================================================================
--- src/lib/elm_bubble.c        (revision 55653)
+++ src/lib/elm_bubble.c        (working copy)
@@ -54,7 +54,11 @@ _theme_hook(Evas_Object *obj)
    _elm_theme_object_set(obj, wd->bbl, "bubble", wd->corner,
                          elm_widget_style_get(obj));
    edje_object_part_text_set(wd->bbl, "elm.text", wd->label);
+   if (wd->label) edje_object_signal_emit(wd->bbl, "elm,state,text,visible", 
"elm");
+   else edje_object_signal_emit(wd->bbl, "elm,state,text,hidden", "elm");
    edje_object_part_text_set(wd->bbl, "elm.info", wd->info);
+   if (wd->info) edje_object_signal_emit(wd->bbl, "elm,state,info,visible", 
"elm");
+   else edje_object_signal_emit(wd->bbl, "elm,state,info,hidden", "elm");
    if (wd->content)
      {
         edje_object_part_swallow(wd->bbl, "elm.swallow.content", wd->content);
@@ -197,6 +201,8 @@ elm_bubble_label_set(Evas_Object *obj, const char
    if (!wd) return;
    eina_stringshare_replace(&wd->label, label);
    edje_object_part_text_set(wd->bbl, "elm.text", label);
+   if (label) edje_object_signal_emit(wd->bbl, "elm,state,text,visible", 
"elm");
+   else edje_object_signal_emit(wd->bbl, "elm,state,text,hidden", "elm");
    _sizing_eval(obj);
 }
 
@@ -241,6 +247,8 @@ elm_bubble_info_set(Evas_Object *obj, const char *
    if (!wd) return;
    eina_stringshare_replace(&wd->info, info);
    edje_object_part_text_set(wd->bbl, "elm.info", info);
+   if (info) edje_object_signal_emit(wd->bbl, "elm,state,info,visible", "elm");
+   else edje_object_signal_emit(wd->bbl, "elm,state,info,hidden", "elm");
    _sizing_eval(obj);
 }
 
Index: data/themes/default.edc
===================================================================
--- data/themes/default.edc     (revision 55653)
+++ data/themes/default.edc     (working copy)
@@ -8922,12 +8922,15 @@ collections {
           color: 0 0 0 255;
           text {
             font: "Sans:style=Bold,Edje-Vera-Bold";
-            size: 10;
             min: 0 1;
             max: 0 1;
             align: 0.0 0.0;
           }
         }
+        description { state: "visible" 0.0;
+          inherit: "default" 0.0;
+          text.size: 10;
+        } 
       }
       part { name: "elm.info";
         type: TEXT;
@@ -8947,12 +8950,15 @@ collections {
           color: 0 0 0 64;
           text {
             font: "Sans:style=Bold,Edje-Vera-Bold";
-            size: 10;
             min: 1 1;
             max: 1 1;
             align: 1.0 0.0;
           }
         }
+        description { state: "visible" 0.0;
+          inherit: "default" 0.0;
+          text.size: 10;
+        } 
       }
       part { name: "base0";
         mouse_events:  0;
@@ -8969,6 +8975,10 @@ collections {
           image.middle: SOLID;
           fill.smooth: 0;
         }
+        description { state: "infobase" 0.0;
+          inherit: "default" 0.0;
+          rel1.to_y: "elm.info";
+        }
       }
       part { name: "elm.swallow.content";
         type: SWALLOW;
@@ -9008,16 +9018,63 @@ collections {
         name: "icon_show";
         signal: "elm,state,icon,visible";
         source: "elm";
-        action: STATE_SET "visible" 0.0;
-        target: "elm.swallow.icon";
+        script {
+          new st[31];
+          new Float:vl;
+          get_state(PART:"base0", st, 30, vl);
+          if (!strcmp(st, "infobase"))
+            set_state(PART:"base0", "default", 0.0);
+          set_state(PART:"elm.swallow.icon", "visible", 0.0);
+        }
       }
       program {
         name: "icon_hide";
         signal: "elm,state,icon,hidden";
         source: "elm";
+        script {
+          new st[31];
+          new Float:vl;
+          get_state(PART:"elm.info", st, 30, vl);
+          if (!strcmp(st, "visible"))
+            set_state(PART:"base0", "infobase", 0.0);
+          set_state(PART:"elm.swallow.icon", "default", 0.0);
+        }
+      }
+      program {
+        name: "text_show";
+        signal: "elm,state,text,visible";
+        source: "elm";
+        action: STATE_SET "visible" 0.0;
+        target: "elm.text";
+      }
+      program {
+        name: "text_hide";
+        signal: "elm,state,text,hidden";
+        source: "elm";
         action: STATE_SET "default" 0.0;
-        target: "elm.swallow.icon";
+        target: "elm.text";
       }
+      program {
+        name: "info_show";
+        signal: "elm,state,info,visible";
+        source: "elm";
+        script {
+          new st[31];
+          new Float:vl;
+          get_state(PART:"elm.swallow.icon", st, 30, vl);
+          if (!strcmp(st, "default"))
+            set_state(PART:"base0", "infobase", 0.0);
+          set_state(PART:"elm.info", "visible", 0.0);
+        }
+      }
+      program {
+        name: "info_hide";
+        signal: "elm,state,info,hidden";
+        source: "elm";
+        action: STATE_SET "default" 0.0;
+        target: "elm.info";
+        target: "base0";
+      }
     }
   }
 
@@ -9076,12 +9133,15 @@ collections {
           color: 0 0 0 255;
           text {
             font: "Sans:style=Bold,Edje-Vera-Bold";
-            size: 10;
             min: 0 1;
             max: 0 1;
             align: 0.0 0.0;
           }
         }
+        description { state: "visible" 0.0;
+          inherit: "default" 0.0;
+          text.size: 10;
+        }
       }
       part { name: "elm.info";
         type: TEXT;
@@ -9102,12 +9162,15 @@ collections {
           color: 0 0 0 64;
           text {
             font: "Sans:style=Bold,Edje-Vera-Bold";
-            size: 10;
             min: 1 1;
             max: 1 1;
             align: 1.0 0.0;
           }
         }
+        description { state: "visible" 0.0;
+          inherit: "default" 0.0;
+          text.size: 10;
+        }
       }
       part { name: "base0";
         mouse_events:  0;
@@ -9124,6 +9187,10 @@ collections {
           image.middle: SOLID;
           fill.smooth: 0;
         }
+        description { state: "infobase" 0.0;
+          inherit: "default" 0.0;
+          rel1.to_y: "elm.info";
+        }
       }
       part { name: "elm.swallow.content";
         type: SWALLOW;
@@ -9163,16 +9230,63 @@ collections {
         name: "icon_show";
         signal: "elm,state,icon,visible";
         source: "elm";
-        action: STATE_SET "visible" 0.0;
-        target: "elm.swallow.icon";
+        script {
+          new st[31];
+          new Float:vl;
+          get_state(PART:"base0", st, 30, vl);
+          if (!strcmp(st, "infobase"))
+            set_state(PART:"base0", "default", 0.0);
+          set_state(PART:"elm.swallow.icon", "visible", 0.0);
+        }
       }
       program {
         name: "icon_hide";
         signal: "elm,state,icon,hidden";
         source: "elm";
+        script {
+          new st[31];
+          new Float:vl;
+          get_state(PART:"elm.info", st, 30, vl);
+          if (!strcmp(st, "visible"))
+            set_state(PART:"base0", "infobase", 0.0);
+          set_state(PART:"elm.swallow.icon", "default", 0.0);
+        }
+      }
+      program {
+        name: "text_show";
+        signal: "elm,state,text,visible";
+        source: "elm";
+        action: STATE_SET "visible" 0.0;
+        target: "elm.text";
+      }
+      program {
+        name: "text_hide";
+        signal: "elm,state,text,hidden";
+        source: "elm";
         action: STATE_SET "default" 0.0;
-        target: "elm.swallow.icon";
+        target: "elm.text";
       }
+      program {
+        name: "info_show";
+        signal: "elm,state,info,visible";
+        source: "elm";
+        script {
+          new st[31];
+          new Float:vl;
+          get_state(PART:"elm.swallow.icon", st, 30, vl);
+          if (!strcmp(st, "default"))
+            set_state(PART:"base0", "infobase", 0.0);
+          set_state(PART:"elm.info", "visible", 0.0);
+        }
+      }
+      program {
+        name: "info_hide";
+        signal: "elm,state,info,hidden";
+        source: "elm";
+        action: STATE_SET "default" 0.0;
+        target: "elm.info";
+        target: "base0";
+      }
     }
   }
 
@@ -9232,12 +9346,15 @@ collections {
           color: 0 0 0 255;
           text {
             font: "Sans:style=Bold,Edje-Vera-Bold";
-            size: 10;
             min: 0 1;
             max: 0 1;
             align: 0.0 1.0;
           }
         }
+        description { state: "visible" 0.0;
+          inherit: "default" 0.0;
+          text.size: 10;
+        }
       }
       part { name: "elm.info";
         type: TEXT;
@@ -9257,12 +9374,15 @@ collections {
           color: 0 0 0 64;
           text {
             font: "Sans:style=Bold,Edje-Vera-Bold";
-            size: 10;
             min: 1 1;
             max: 1 1;
             align: 1.0 1.0;
           }
         }
+        description { state: "visible" 0.0;
+          inherit: "default" 0.0;
+          text.size: 10;
+        }
       }
       part { name: "base0";
         mouse_events:  0;
@@ -9279,6 +9399,10 @@ collections {
           image.middle: SOLID;
           fill.smooth: 0;
         }
+        description { state: "infobase" 0.0;
+          inherit: "default" 0.0;
+          rel2.to_y: "elm.info";
+        }
       }
       part { name: "elm.swallow.content";
         type: SWALLOW;
@@ -9318,16 +9442,63 @@ collections {
         name: "icon_show";
         signal: "elm,state,icon,visible";
         source: "elm";
-        action: STATE_SET "visible" 0.0;
-        target: "elm.swallow.icon";
+        script {
+          new st[31];
+          new Float:vl;
+          get_state(PART:"base0", st, 30, vl);
+          if (!strcmp(st, "infobase"))
+            set_state(PART:"base0", "default", 0.0);
+          set_state(PART:"elm.swallow.icon", "visible", 0.0);
+        }
       }
       program {
         name: "icon_hide";
         signal: "elm,state,icon,hidden";
         source: "elm";
+        script {
+          new st[31];
+          new Float:vl;
+          get_state(PART:"elm.info", st, 30, vl);
+          if (!strcmp(st, "visible"))
+            set_state(PART:"base0", "infobase", 0.0);
+          set_state(PART:"elm.swallow.icon", "default", 0.0);
+        }
+      }
+      program {
+        name: "text_show";
+        signal: "elm,state,text,visible";
+        source: "elm";
+        action: STATE_SET "visible" 0.0;
+        target: "elm.text";
+      }
+      program {
+        name: "text_hide";
+        signal: "elm,state,text,hidden";
+        source: "elm";
         action: STATE_SET "default" 0.0;
-        target: "elm.swallow.icon";
+        target: "elm.text";
       }
+      program {
+        name: "info_show";
+        signal: "elm,state,info,visible";
+        source: "elm";
+        script {
+          new st[31];
+          new Float:vl;
+          get_state(PART:"elm.swallow.icon", st, 30, vl);
+          if (!strcmp(st, "default"))
+            set_state(PART:"base0", "infobase", 0.0);
+          set_state(PART:"elm.info", "visible", 0.0);
+        }
+      }
+      program {
+        name: "info_hide";
+        signal: "elm,state,info,hidden";
+        source: "elm";
+        action: STATE_SET "default" 0.0;
+        target: "elm.info";
+        target: "base0";
+      }
     }
   }
 
@@ -9386,12 +9557,15 @@ collections {
           color: 0 0 0 255;
           text {
             font: "Sans:style=Bold,Edje-Vera-Bold";
-            size: 10;
             min: 0 1;
             max: 0 1;
             align: 0.0 1.0;
           }
         }
+        description { state: "visible" 0.0;
+          inherit: "default" 0.0;
+          text.size: 10;
+        }
       }
       part { name: "elm.info";
         type: TEXT;
@@ -9412,12 +9586,15 @@ collections {
           color: 0 0 0 64;
           text {
             font: "Sans:style=Bold,Edje-Vera-Bold";
-            size: 10;
             min: 1 1;
             max: 1 1;
             align: 1.0 1.0;
           }
         }
+        description { state: "visible" 0.0;
+          inherit: "default" 0.0;
+          text.size: 10;
+        }
       }
       part { name: "base0";
         mouse_events:  0;
@@ -9434,6 +9611,10 @@ collections {
           image.middle: SOLID;
           fill.smooth: 0;
         }
+        description { state: "infobase" 0.0;
+          inherit: "default" 0.0;
+          rel2.to_y: "elm.info";
+        }
       }
       part { name: "elm.swallow.content";
         type: SWALLOW;
@@ -9473,16 +9654,63 @@ collections {
         name: "icon_show";
         signal: "elm,state,icon,visible";
         source: "elm";
-        action: STATE_SET "visible" 0.0;
-        target: "elm.swallow.icon";
+        script {
+          new st[31];
+          new Float:vl;
+          get_state(PART:"base0", st, 30, vl);
+          if (!strcmp(st, "infobase"))
+            set_state(PART:"base0", "default", 0.0);
+          set_state(PART:"elm.swallow.icon", "visible", 0.0);
+        }
       }
       program {
         name: "icon_hide";
         signal: "elm,state,icon,hidden";
         source: "elm";
+        script {
+          new st[31];
+          new Float:vl;
+          get_state(PART:"elm.info", st, 30, vl);
+          if (!strcmp(st, "visible"))
+            set_state(PART:"base0", "infobase", 0.0);
+          set_state(PART:"elm.swallow.icon", "default", 0.0);
+        }
+      }
+      program {
+        name: "text_show";
+        signal: "elm,state,text,visible";
+        source: "elm";
+        action: STATE_SET "visible" 0.0;
+        target: "elm.text";
+      }
+      program {
+        name: "text_hide";
+        signal: "elm,state,text,hidden";
+        source: "elm";
         action: STATE_SET "default" 0.0;
-        target: "elm.swallow.icon";
+        target: "elm.text";
       }
+      program {
+        name: "info_show";
+        signal: "elm,state,info,visible";
+        source: "elm";
+        script {
+          new st[31];
+          new Float:vl;
+          get_state(PART:"elm.swallow.icon", st, 30, vl);
+          if (!strcmp(st, "default"))
+            set_state(PART:"base0", "infobase", 0.0);
+          set_state(PART:"elm.info", "visible", 0.0);
+        }
+      }
+      program {
+        name: "info_hide";
+        signal: "elm,state,info,hidden";
+        source: "elm";
+        action: STATE_SET "default" 0.0;
+        target: "elm.info";
+        target: "base0";
+      }
     }
   }
 
Index: AUTHORS
===================================================================
--- AUTHORS     (revision 55653)
+++ AUTHORS     (working copy)
@@ -28,3 +28,4 @@ Tiago Falcão <ti...@profusion.mobi>
 Otavio Pontes <ota...@profusion.mobi>
 Viktor Kojouharov <vkojouha...@gmail.com>
 Daniel Juyung Seo (SeoZ) <juyung....@samsung.com> <seojuyu...@gmail.com>
+Sohyun Kim <anna1014....@samsung.com>
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to