e_dialog_title_set(dia->dia, "Color Selector");
dia->color = calloc(1, sizeof(E_Color));
+ dia->initial = calloc(1, sizeof(E_Color));
if (color)
e_color_copy(color, dia->color);
else
dia->color->a = 255;
+ e_color_copy(dia->color, dia->initial);
+
o = e_widget_csel_add(dia->dia->win->evas, dia->color);
evas_object_show(o);
e_widget_min_size_get(o, &mw, &mh);
E_Color_Dialog *dia;
dia = data;
- if(dia->cancel_func && dia->color)
- dia->cancel_func(dia, dia->color, dia->cancel_data);
+ if(dia->cancel_func && dia->initial)
+ dia->cancel_func(dia, dia->initial, dia->cancel_data);
_e_color_dialog_free(data);
}
E_Container *con;
E_Dialog *dia;
- E_Color *color;
+ E_Color *color, *initial;
void (*select_func)(E_Color_Dialog *dia, E_Color *color, void *data);
void *select_data;
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);
+
+/* select and change pass the current color back, cancel passes the initial color */
EAPI void e_color_dialog_select_callback_set(E_Color_Dialog *dia, void (*func)(E_Color_Dialog *dia, E_Color *color, void *data), void *data);
EAPI void e_color_dialog_cancel_callback_set(E_Color_Dialog *dia, void (*func)(E_Color_Dialog *dia, E_Color *color, void *data), void *data);
EAPI void e_color_dialog_change_callback_set(E_Color_Dialog *dia, void (*func)(E_Color_Dialog *dia, E_Color *color, void *data), void *data);