Enlightenment CVS committal Author : devilhorns Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_widget_color_well.c Log Message: Add a "disabled" state for color well. Thanks rephorm :) =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_widget_color_well.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- e_widget_color_well.c 30 Sep 2006 10:16:23 -0000 1.8 +++ e_widget_color_well.c 3 Oct 2006 14:14:11 -0000 1.9 @@ -20,6 +20,7 @@ static void _e_wid_signal_cb1(void *data, Evas_Object *obj, const char *emission, const char *source); static void _e_wid_color_select_cb(E_Color_Dialog *dia, E_Color *color, void *data); static void _e_wid_color_cancel_cb(E_Color_Dialog *dia, E_Color *color, void *data); +static void _e_wid_disable_hook(Evas_Object *obj); static void _e_wid_update(E_Widget_Data *wd) @@ -83,9 +84,28 @@ E_FREE(wd); } +static void +_e_wid_disable_hook(Evas_Object *obj) +{ + E_Widget_Data *wd; + + wd = e_widget_data_get(obj); + if (e_widget_disabled_get(obj)) + { + wd->show_color_dialog = 0; + edje_object_signal_emit(wd->o_edje, "e,state,disabled", "e"); + } + else + { + wd->show_color_dialog = 1; + edje_object_signal_emit(wd->o_edje, "e,state,enabled", "e"); + } +} + /** * Add a color well widget to an evas. - * An optional E_Container may be passed in. If not NULL, when clicked a color dialog will pop up. + * An optional E_Container may be passed in. + If not NULL, when clicked a color dialog will pop up. */ Evas_Object * e_widget_color_well_add(Evas *evas, E_Color *color, int show_color_dialog) @@ -97,6 +117,7 @@ obj = e_widget_add(evas); e_widget_del_hook_set(obj, _e_wid_del_hook); + e_widget_disable_hook_set(obj, _e_wid_disable_hook); wd = calloc(1, sizeof(E_Widget_Data)); e_widget_data_set(obj, wd); @@ -113,7 +134,8 @@ e_widget_resize_object_set(obj, o); e_theme_edje_object_set(o, "base/theme/widgets", "e/widgets/color_well"); - edje_object_signal_callback_add(o, "e,action,click", "", _e_wid_signal_cb1, obj); + edje_object_signal_callback_add(o, "e,action,click", "", + _e_wid_signal_cb1, obj); evas_object_show(o); wd->o_edje = o; @@ -145,5 +167,3 @@ wd = e_widget_data_get(obj); _e_wid_update(wd); } - - ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs