Enlightenment CVS committal Author : rephorm Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_color.c e_color.h e_color_dialog.c e_color_dialog.h e_int_config_wallpaper_gradient.c e_test.c e_widget_color_well.c e_widget_color_well.h e_widget_csel.c Log Message: when clicking on a color well, initialize the color selector to the well's color few other cleanups =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_color.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_color.c 16 Aug 2006 04:43:20 -0000 1.2 +++ e_color.c 20 Aug 2006 22:15:27 -0000 1.3 @@ -19,7 +19,7 @@ } void -e_color_copy(E_Color *from, E_Color *to) +e_color_copy(const E_Color *from, E_Color *to) { if (!from || !to) return; to->r = from->r; =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_color.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- e_color.h 16 Aug 2006 05:29:53 -0000 1.3 +++ e_color.h 20 Aug 2006 22:15:27 -0000 1.4 @@ -31,6 +31,6 @@ EAPI void e_color_update_rgb (E_Color *ec); EAPI void e_color_update_hsv (E_Color *ec); -EAPI void e_color_copy (E_Color *from, E_Color *to); +EAPI void e_color_copy (const E_Color *from, E_Color *to); #endif #endif =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_color_dialog.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- e_color_dialog.c 20 Aug 2006 21:18:29 -0000 1.1 +++ e_color_dialog.c 20 Aug 2006 22:15:27 -0000 1.2 @@ -8,8 +8,14 @@ static void _e_color_dialog_button2_click(void *data, E_Dialog *edia); static void _e_color_dialog_free(E_Color_Dialog *dia); +/** + * Create a color selector dialog. + * + * @param con container to display on + * @param color color to initialize to (or NULL for black). + */ E_Color_Dialog * -e_color_dialog_new (E_Container *con) +e_color_dialog_new (E_Container *con, const E_Color *color) { E_Color_Dialog *dia; Evas_Object *o; @@ -21,7 +27,11 @@ e_dialog_title_set(dia->dia, "Color Selector"); dia->color = calloc(1, sizeof(E_Color)); - dia->color->a = 255; + + if (color) + e_color_copy(color, dia->color); + else + dia->color->a = 255; o = e_widget_csel_add(dia->dia->win->evas, dia->color); evas_object_show(o); =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_color_dialog.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- e_color_dialog.h 20 Aug 2006 21:18:29 -0000 1.1 +++ e_color_dialog.h 20 Aug 2006 22:15:27 -0000 1.2 @@ -26,7 +26,7 @@ void *cancel_data; }; -EAPI E_Color_Dialog *e_color_dialog_new (E_Container *con); +EAPI E_Color_Dialog *e_color_dialog_new (E_Container *con, const E_Color *initial_color); EAPI void e_color_dialog_show (E_Color_Dialog *dia); EAPI void e_color_dialog_title_set (E_Color_Dialog *dia, const char *title); EAPI void e_color_dialog_select_callback_add(E_Color_Dialog *dia, void (*func)(E_Color_Dialog *dia, E_Color *color, void *data), void *data); =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_wallpaper_gradient.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- e_int_config_wallpaper_gradient.c 20 Aug 2006 21:18:29 -0000 1.1 +++ e_int_config_wallpaper_gradient.c 20 Aug 2006 22:15:27 -0000 1.2 @@ -129,17 +129,17 @@ evas_object_show(o); e_widget_table_object_append(ot, o, 2, 1, 1, 1, 1, 1, 1, 1); - o = e_widget_color_well_add(evas, cfdata->color1, parent->con); + o = e_widget_color_well_add(evas, cfdata->color1, 1); evas_object_show(o); e_widget_table_object_append(ot, o, 2, 2, 1, 1, 1, 1, 1, 1); - o = e_widget_color_well_add(evas, cfdata->color2, parent->con); + o = e_widget_color_well_add(evas, cfdata->color2, 1); evas_object_show(o); e_widget_table_object_append(ot, o, 2, 3, 1, 1, 1, 1, 1, 1); e_widget_list_object_append(ol, ot, 1, 1, 0.5); - of = e_widget_framelist_add(evas, "Fill and Spread Options", 1); + of = e_widget_framelist_add(evas, "Fill Options", 1); rg = e_widget_radio_group_new(&(cfdata->mode)); @@ -172,7 +172,7 @@ e_dialog_button_add(dia, _("Cancel"), NULL, _import_cb_close, cfdata); _import_opt_disabled_set(import, 1); - e_dialog_resizable_set(dia, 1); + e_dialog_resizable_set(dia, 0); e_dialog_show(dia); return dia; } =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_test.c,v retrieving revision 1.69 retrieving revision 1.70 diff -u -3 -r1.69 -r1.70 --- e_test.c 20 Aug 2006 21:18:29 -0000 1.69 +++ e_test.c 20 Aug 2006 22:15:27 -0000 1.70 @@ -662,7 +662,7 @@ { E_Color_Dialog *d; - d = e_color_dialog_new(con); + d = e_color_dialog_new(con, NULL); e_color_dialog_show(d); e_color_dialog_select_callback_add(d, _e_test_cb_ok, NULL); } =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_widget_color_well.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_widget_color_well.c 20 Aug 2006 21:18:30 -0000 1.2 +++ e_widget_color_well.c 20 Aug 2006 22:15:27 -0000 1.3 @@ -13,6 +13,7 @@ E_Color_Dialog *dia; E_Color *color; E_Container *con; // container to pop a color dialog up on + int show_color_dialog; }; static void _e_wid_update(E_Widget_Data *wd); @@ -38,10 +39,10 @@ wid = data; wd = e_widget_data_get(wid); - if (!wd->con) return; + if (!wd->show_color_dialog || !wd->con) return; if (!wd->dia) { - wd->dia = e_color_dialog_new(wd->con); + wd->dia = e_color_dialog_new(wd->con, wd->color); e_color_dialog_select_callback_add(wd->dia, _e_wid_color_select_cb, wd); e_color_dialog_cancel_callback_add(wd->dia, _e_wid_color_cancel_cb, wd); } @@ -83,11 +84,12 @@ * 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, E_Container *con) +e_widget_color_well_add(Evas *evas, E_Color *color, int show_color_dialog) { Evas_Object *obj, *o; Evas_Coord mw, mh; E_Widget_Data *wd; + E_Win *win; obj = e_widget_add(evas); e_widget_del_hook_set(obj, _e_wid_del_hook); @@ -97,7 +99,10 @@ wd->obj = obj; wd->color = color; - wd->con = con; + win = e_win_evas_object_win_get(obj); + wd->con = win->container; + + wd->show_color_dialog = show_color_dialog; o = edje_object_add(evas); e_widget_sub_object_add(obj, o); =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_widget_color_well.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_widget_color_well.h 20 Aug 2006 21:18:30 -0000 1.2 +++ e_widget_color_well.h 20 Aug 2006 22:15:27 -0000 1.3 @@ -1,7 +1,7 @@ #ifndef E_WIDGET_COLOR_WELL_H #define E_WIDGET_COLOR_WELL_H -EAPI Evas_Object *e_widget_color_well_add (Evas *evas, E_Color *color, E_Container *con); +EAPI Evas_Object *e_widget_color_well_add (Evas *evas, E_Color *color, int show_color_dialog); EAPI void e_widget_color_well_update (Evas_Object *obj); #endif =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_widget_csel.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- e_widget_csel.c 20 Aug 2006 21:18:30 -0000 1.6 +++ e_widget_csel.c 20 Aug 2006 22:15:27 -0000 1.7 @@ -256,7 +256,7 @@ e_widget_table_object_append(table, frame, 3, 1, 1, 1, 1, 1, 1, 1); - o = e_widget_color_well_add(evas, wd->cv, NULL); + o = e_widget_color_well_add(evas, wd->cv, 0); e_widget_sub_object_add(obj, o); evas_object_show(o); wd->well = o; ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs