elementary/colorselector - send signal when mode is changed so as to set the padding...
authorhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 2 Apr 2012 04:22:46 +0000 (04:22 +0000)
committerhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 2 Apr 2012 04:22:46 +0000 (04:22 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@69842 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

data/themes/widgets/colorselector.edc
src/bin/test_colorselector.c
src/lib/elm_colorselector.c

index 0967dce..5ae8d16 100644 (file)
@@ -29,6 +29,10 @@ group {
             rel2.to: "palette";
             align: 0.0 0.0;
          }
+         description { state: "disabled" 0.0;
+            inherit: "default" 0.0;
+            min: 0 0;
+         }
       }
       part { name: "selector";
          type: SWALLOW;
@@ -42,6 +46,27 @@ group {
          }
       }
    }
+   programs {
+      program { name: "palette";
+         source: "elm";
+         signal: "elm,state,palette";
+         action: STATE_SET "disabled" 0.0;
+         target: "bottom_padding";
+      }
+      program { name: "components";
+         source: "elm";
+         signal: "elm,state,components";
+         action: STATE_SET "disabled" 0.0;
+         target: "bottom_padding";
+      }
+      program { name: "both";
+         source: "elm";
+         signal: "elm,state,both";
+         action: STATE_SET "default" 0.0;
+         target: "bottom_padding";
+      }
+
+   }
 }
 
 group { name: "elm/colorselector/bg/default";
index a0a2051..67fa219 100644 (file)
@@ -59,7 +59,7 @@ _components_cb(void *data, Evas_Object *obj __UNUSED__,
    Evas_Object *cs = data;
    Evas_Object *win = evas_object_data_get(cs, "win");
    elm_colorselector_mode_set(cs, ELM_COLORSELECTOR_COMPONENTS);
-   evas_object_resize(win, 320, 350);
+   evas_object_resize(win, 320, 455);
 }
 
 static void
@@ -68,7 +68,7 @@ _both_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
    Evas_Object *cs = data;
    Evas_Object *win = evas_object_data_get(cs, "win");
    elm_colorselector_mode_set(cs, ELM_COLORSELECTOR_BOTH);
-   evas_object_resize(win, 320, 480);
+   evas_object_resize(win, 320, 535);
 }
 
 void
@@ -180,7 +180,7 @@ test_colorselector(void *data __UNUSED__, Evas_Object *obj __UNUSED__,
    evas_object_show(bt);
    elm_box_pack_end(bx2, bt);
 
-   evas_object_resize(win, 320, 480);
+   evas_object_resize(win, 320, 500);
    evas_object_show(win);
 }
 #endif
index 24d1647..f650855 100644 (file)
@@ -1141,6 +1141,7 @@ elm_colorselector_mode_set(Evas_Object *obj, Elm_Colorselector_Mode mode)
                 edje_object_part_swallow(wd->base, "palette", wd->box);
                 evas_object_show(wd->box);
              }
+           edje_object_signal_emit(wd->base, "elm,state,palette", "elm");
            break;
         case ELM_COLORSELECTOR_COMPONENTS:
            if (edje_object_part_swallow_get(wd->base, "palette"))
@@ -1153,6 +1154,7 @@ elm_colorselector_mode_set(Evas_Object *obj, Elm_Colorselector_Mode mode)
                 edje_object_part_swallow(wd->base, "selector", wd->sel);
                 evas_object_show(wd->sel);
              }
+           edje_object_signal_emit(wd->base, "elm,state,components", "elm");
            break;
         case ELM_COLORSELECTOR_BOTH:
            if (!edje_object_part_swallow_get(wd->base, "palette"))
@@ -1165,10 +1167,13 @@ elm_colorselector_mode_set(Evas_Object *obj, Elm_Colorselector_Mode mode)
                 edje_object_part_swallow(wd->base, "selector", wd->sel);
                 evas_object_show(wd->sel);
              }
+           edje_object_signal_emit(wd->base, "elm,state,both", "elm");
            break;
         default:
            return;
      }
+   edje_object_message_signal_process(wd->base);
+
    _sizing_eval(obj);
 }