forked from enlightenment/enlightenment
* crosshairs show in proper place in spectrum initially
* a color well's dialog closes when the well is deleted * the X border button calls the cancel cb for the color dialog * the X on the grad dialog now works SVN revision: 24964
This commit is contained in:
parent
bec1e617e8
commit
3b84d85303
|
@ -7,6 +7,7 @@
|
||||||
static void _e_color_dialog_button1_click(void *data, E_Dialog *edia);
|
static void _e_color_dialog_button1_click(void *data, E_Dialog *edia);
|
||||||
static void _e_color_dialog_button2_click(void *data, E_Dialog *edia);
|
static void _e_color_dialog_button2_click(void *data, E_Dialog *edia);
|
||||||
static void _e_color_dialog_free(E_Color_Dialog *dia);
|
static void _e_color_dialog_free(E_Color_Dialog *dia);
|
||||||
|
static void _e_color_dialog_dia_del(E_Object *obj);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a color selector dialog.
|
* Create a color selector dialog.
|
||||||
|
@ -44,6 +45,9 @@ e_color_dialog_new (E_Container *con, const E_Color *color)
|
||||||
e_dialog_resizable_set(dia->dia, 1);
|
e_dialog_resizable_set(dia->dia, 1);
|
||||||
e_win_centered_set(dia->dia->win, 1);
|
e_win_centered_set(dia->dia->win, 1);
|
||||||
|
|
||||||
|
dia->dia->data = dia;
|
||||||
|
e_object_del_attach_func_set(E_OBJECT(dia->dia), _e_color_dialog_dia_del);
|
||||||
|
|
||||||
return dia;
|
return dia;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +92,7 @@ static void
|
||||||
_e_color_dialog_button2_click(void *data, E_Dialog *edia)
|
_e_color_dialog_button2_click(void *data, E_Dialog *edia)
|
||||||
{
|
{
|
||||||
E_Color_Dialog *dia;
|
E_Color_Dialog *dia;
|
||||||
|
|
||||||
dia = data;
|
dia = data;
|
||||||
if(dia->cancel_func && dia->color)
|
if(dia->cancel_func && dia->color)
|
||||||
dia->cancel_func(dia, dia->color, dia->cancel_data);
|
dia->cancel_func(dia, dia->color, dia->cancel_data);
|
||||||
|
@ -98,8 +102,15 @@ _e_color_dialog_button2_click(void *data, E_Dialog *edia)
|
||||||
static void
|
static void
|
||||||
_e_color_dialog_free(E_Color_Dialog *dia)
|
_e_color_dialog_free(E_Color_Dialog *dia)
|
||||||
{
|
{
|
||||||
printf("DIALOG FREE!\n");
|
|
||||||
e_object_unref(E_OBJECT(dia->dia));
|
e_object_unref(E_OBJECT(dia->dia));
|
||||||
E_FREE(dia->color);
|
E_FREE(dia->color);
|
||||||
E_FREE(dia);
|
E_FREE(dia);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_color_dialog_dia_del(E_Object *obj)
|
||||||
|
{
|
||||||
|
E_Dialog *dia = obj;
|
||||||
|
E_Color_Dialog *cdia = dia->data;
|
||||||
|
_e_color_dialog_button2_click(cdia, dia);
|
||||||
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ struct _E_Color_Dialog
|
||||||
E_Dialog *dia;
|
E_Dialog *dia;
|
||||||
|
|
||||||
E_Color *color;
|
E_Color *color;
|
||||||
|
|
||||||
void (*select_func)(E_Color_Dialog *dia, E_Color *color, void *data);
|
void (*select_func)(E_Color_Dialog *dia, E_Color *color, void *data);
|
||||||
void *select_data;
|
void *select_data;
|
||||||
void (*cancel_func)(E_Color_Dialog *dia, E_Color *color, void *data);
|
void (*cancel_func)(E_Color_Dialog *dia, E_Color *color, void *data);
|
||||||
|
|
|
@ -58,6 +58,7 @@ static void _import_cb_delete(E_Win *win);
|
||||||
static void _import_cb_close(void *data, E_Dialog *dia);
|
static void _import_cb_close(void *data, E_Dialog *dia);
|
||||||
static void _import_cb_ok(void *data, E_Dialog *dia);
|
static void _import_cb_ok(void *data, E_Dialog *dia);
|
||||||
static void _import_config_save(Import *import);
|
static void _import_config_save(Import *import);
|
||||||
|
static void _import_cb_dia_del(E_Object *obj);
|
||||||
|
|
||||||
EAPI E_Dialog *
|
EAPI E_Dialog *
|
||||||
e_int_config_wallpaper_gradient(E_Config_Dialog *parent)
|
e_int_config_wallpaper_gradient(E_Config_Dialog *parent)
|
||||||
|
@ -81,7 +82,9 @@ e_int_config_wallpaper_gradient(E_Config_Dialog *parent)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dia->win->data = import;
|
dia->data = import;
|
||||||
|
e_object_del_attach_func_set(E_OBJECT(dia), _import_cb_dia_del);
|
||||||
|
e_win_centered_set(dia->win, 1);
|
||||||
|
|
||||||
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
||||||
cfdata->mode = GRAD_H;
|
cfdata->mode = GRAD_H;
|
||||||
|
@ -96,7 +99,6 @@ e_int_config_wallpaper_gradient(E_Config_Dialog *parent)
|
||||||
import->parent = parent;
|
import->parent = parent;
|
||||||
|
|
||||||
e_dialog_title_set(dia, _("Create a gradient..."));
|
e_dialog_title_set(dia, _("Create a gradient..."));
|
||||||
// e_win_delete_callback_set(dia->win, _import_cb_delete);
|
|
||||||
|
|
||||||
cfdata->color1 = calloc(1, sizeof(E_Color));
|
cfdata->color1 = calloc(1, sizeof(E_Color));
|
||||||
cfdata->color1->a = 255;
|
cfdata->color1->a = 255;
|
||||||
|
@ -190,7 +192,7 @@ e_int_config_wallpaper_gradient_del(E_Dialog *dia)
|
||||||
{
|
{
|
||||||
Import *import;
|
Import *import;
|
||||||
|
|
||||||
import = dia->win->data;
|
import = dia->data;
|
||||||
_import_config_save(import);
|
_import_config_save(import);
|
||||||
|
|
||||||
if (import->exe_handler) ecore_event_handler_del(import->exe_handler);
|
if (import->exe_handler) ecore_event_handler_del(import->exe_handler);
|
||||||
|
@ -375,11 +377,6 @@ _import_cb_edje_cc_exit(void *data, int type, void *event)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_import_cb_delete(E_Win *win)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_import_cb_close(void *data, E_Dialog *dia)
|
_import_cb_close(void *data, E_Dialog *dia)
|
||||||
{
|
{
|
||||||
|
@ -391,7 +388,7 @@ _import_cb_ok(void *data, E_Dialog *dia)
|
||||||
{
|
{
|
||||||
Import *import;
|
Import *import;
|
||||||
|
|
||||||
import = dia->win->data;
|
import = dia->data;
|
||||||
|
|
||||||
if (dia && import->cfdata->name)
|
if (dia && import->cfdata->name)
|
||||||
{
|
{
|
||||||
|
@ -401,3 +398,9 @@ _import_cb_ok(void *data, E_Dialog *dia)
|
||||||
e_int_config_wallpaper_gradient_del(dia);
|
e_int_config_wallpaper_gradient_del(dia);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_import_cb_dia_del(E_Object *obj)
|
||||||
|
{
|
||||||
|
E_Dialog *dia = obj;
|
||||||
|
e_int_config_wallpaper_gradient_del(dia);
|
||||||
|
}
|
||||||
|
|
|
@ -76,6 +76,7 @@ _e_wid_del_hook(Evas_Object *obj)
|
||||||
wd = e_widget_data_get(obj);
|
wd = e_widget_data_get(obj);
|
||||||
if (!wd) return;
|
if (!wd) return;
|
||||||
|
|
||||||
|
if (wd->dia) e_object_unref(E_OBJECT(wd->dia));
|
||||||
E_FREE(wd);
|
E_FREE(wd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,21 +68,33 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o)
|
||||||
{
|
{
|
||||||
case E_COLOR_COMPONENT_R:
|
case E_COLOR_COMPONENT_R:
|
||||||
wd->cv->r = atoi(wd->values[i]);
|
wd->cv->r = atoi(wd->values[i]);
|
||||||
|
if (wd->cv->r > 255) wd->cv->r = 255;
|
||||||
|
if (wd->cv->r < 0) wd->cv->r = 0;
|
||||||
break;
|
break;
|
||||||
case E_COLOR_COMPONENT_G:
|
case E_COLOR_COMPONENT_G:
|
||||||
wd->cv->g = atoi(wd->values[i]);
|
wd->cv->g = atoi(wd->values[i]);
|
||||||
|
if (wd->cv->g > 255) wd->cv->g = 255;
|
||||||
|
if (wd->cv->g < 0) wd->cv->g = 0;
|
||||||
break;
|
break;
|
||||||
case E_COLOR_COMPONENT_B:
|
case E_COLOR_COMPONENT_B:
|
||||||
wd->cv->b = atoi(wd->values[i]);
|
wd->cv->b = atoi(wd->values[i]);
|
||||||
|
if (wd->cv->b > 255) wd->cv->b = 255;
|
||||||
|
if (wd->cv->b < 0) wd->cv->b = 0;
|
||||||
break;
|
break;
|
||||||
case E_COLOR_COMPONENT_H:
|
case E_COLOR_COMPONENT_H:
|
||||||
wd->cv->h = atof(wd->values[i]);
|
wd->cv->h = atof(wd->values[i]);
|
||||||
|
if (wd->cv->h > 360) wd->cv->h = 360;
|
||||||
|
if (wd->cv->h < 0) wd->cv->h = 0;
|
||||||
break;
|
break;
|
||||||
case E_COLOR_COMPONENT_S:
|
case E_COLOR_COMPONENT_S:
|
||||||
wd->cv->s = atof(wd->values[i]);
|
wd->cv->s = atof(wd->values[i]);
|
||||||
|
if (wd->cv->s > 1) wd->cv->s = 1;
|
||||||
|
if (wd->cv->s < 0) wd->cv->s = 0;
|
||||||
break;
|
break;
|
||||||
case E_COLOR_COMPONENT_V:
|
case E_COLOR_COMPONENT_V:
|
||||||
wd->cv->v = atof(wd->values[i]);
|
wd->cv->v = atof(wd->values[i]);
|
||||||
|
if (wd->cv->v > 1) wd->cv->v = 1;
|
||||||
|
if (wd->cv->v < 0) wd->cv->v = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -84,6 +84,8 @@ e_widget_spectrum_add(Evas *evas, E_Color_Component mode, E_Color *cv)
|
||||||
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _e_wid_cb_up, obj);
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _e_wid_cb_up, obj);
|
||||||
wd->o_event = o;
|
wd->o_event = o;
|
||||||
|
|
||||||
|
e_widget_spectrum_update(obj, 0);
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue