diff --git a/data/themes/Makefile.am b/data/themes/Makefile.am index 9a40d3f2b..bf4be83fe 100644 --- a/data/themes/Makefile.am +++ b/data/themes/Makefile.am @@ -55,7 +55,8 @@ default_textblock.edc \ default_shelf.edc \ default_preview.edc \ default_cslider.edc \ -default_spectrum.edc +default_spectrum.edc \ +default_color_well.edc default.edj: Makefile $(EXTRA_DIST) $(EDJE_CC) $(EDJE_FLAGS) \ diff --git a/data/themes/default.edc b/data/themes/default.edc index 5b7d886b3..c81b07bf0 100644 --- a/data/themes/default.edc +++ b/data/themes/default.edc @@ -64,5 +64,6 @@ collections { #include "default_preview.edc" #include "default_cslider.edc" #include "default_spectrum.edc" +#include "default_color_well.edc" } diff --git a/data/themes/default_color_well.edc b/data/themes/default_color_well.edc new file mode 100644 index 000000000..cc304e619 --- /dev/null +++ b/data/themes/default_color_well.edc @@ -0,0 +1,79 @@ +images { + image: "e17_well_overlay.png" COMP; +} + +group { + name: "widgets/color_well"; + parts { + part { + name: "background"; + mouse_events: 0; + description { + state: "default" 0.0; + min: 50 50; + rel1 { + to: "overlay"; + } + rel2 { + to: "overlay"; + } + image { + normal: "e17_ibar_bg_h.png"; + border: 6 6 6 6; + } + fill { + smooth: 0; + } + } + } + part { + name: "content_clip"; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + rel1 { + to: "background"; + offset: 4 4; + } + rel2 { + to: "background"; + offset: -5 -5; + } + color: 255 255 255 255; + } + } + part { + name: "content"; + type: SWALLOW; + mouse_events: 0; + clip_to: "content_clip"; + description { + state: "default" 0.0; + rel1 { + offset: 4 4; + } + rel2 { + offset: -5 -5; + } + color: 0 0 0 0; + } + } + part { + name: "overlay"; + mouse_events: 0; + description { + state: "default" 0.0; + image { + normal: "e17_well_overlay.png"; + border: 13 13 13 13; + middle: 0; + } + fill { + smooth: 0; + } + } + } + + } +} diff --git a/data/themes/default_cslider.edc b/data/themes/default_cslider.edc index 8ea73c8d8..18b7de37e 100644 --- a/data/themes/default_cslider.edc +++ b/data/themes/default_cslider.edc @@ -1,78 +1,124 @@ group { name: "widgets/cslider"; parts { - part { - name: "bg"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - color: 0 0 0 100; - min: 0 20; - max: 99999 20; - rel1.offset: 2 2; - rel2.offset: -3 -3; + part { + name: "background"; + mouse_events: 0; + description { + state: "default" 0.0; + min: 50 20; + rel1 { + to: "overlay"; + } + rel2 { + to: "overlay"; + } + image { + normal: "e17_ibar_bg_h.png"; + border: 6 6 6 6; + } + fill { + smooth: 0; + } + } + description { + state: "vertical" 0.0; + inherit: "default" 0.0; + min: 20 50; + } } - description { - state: "vertical" 0.0; - inherit: "default" 0.0; - min: 20 0; - max: 20 99999; + part { + name: "content_clip"; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + rel1 { + to: "background"; + offset: 4 4; + } + rel2 { + to: "background"; + offset: -5 -5; + } + color: 255 255 255 255; + } } - } - part { - name: "gradient"; - type: SWALLOW; - mouse_events: 0; - description { - state: "default" 0.0; - rel1.to: "bg"; - rel1.offset: 1 1; - rel2.to: "bg"; - rel2.offset: -2 -2; + part { + name: "content"; + type: SWALLOW; + mouse_events: 0; + clip_to: "content_clip"; + description { + state: "default" 0.0; + rel1 { + offset: 4 4; + } + rel2 { + offset: -5 -5; + } + color: 0 0 0 0; + } } - } part { name: "cursor"; type: RECT; + clip_to: "content_clip"; dragable { - confine: "gradient"; + confine: "content"; x: 1 1 0; y: -1 1 0; } description { state: "default" 0.0; - min: 3 16; - max: 3 9999; + min: 1 16; + max: 1 9999; fixed: 1 1; rel1 { - to: "gradient"; + to: "content"; relative: 0.5 0; offset: 0 0; } rel2 { - to: "gradient"; + to: "content"; relative: 0.5 1; offset: 0 -1; } } description { state: "vertical" 0.0; - min: 16 3; - max: 9999 3; + min: 16 1; + max: 9999 1; fixed: 1 1; rel1 { - to: "gradient"; + to: "content"; relative: 0 0.5 ; offset: 0 0; } rel2 { - to: "gradient"; + to: "content"; relative: 1 0.5; offset: -1 0; } } } + + part { + name: "overlay"; + mouse_events: 0; + description { + state: "default" 0.0; + image { + normal: "e17_well_overlay.png"; + border: 13 13 13 13; + middle: 0; + } + fill { + smooth: 0; + } + } + } + } programs { program { @@ -81,7 +127,7 @@ group { source: ""; action: STATE_SET "vertical" 0.0; target: "cursor"; - target: "bg"; + target: "background"; } } } diff --git a/data/themes/default_spectrum.edc b/data/themes/default_spectrum.edc index 2dc2c9732..5546ad503 100644 --- a/data/themes/default_spectrum.edc +++ b/data/themes/default_spectrum.edc @@ -1,53 +1,88 @@ +images { + image: "e17_well_overlay.png" COMP; +} + group { name: "widgets/spectrum"; parts { - part { - name: "bg"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - aspect: 1 1; - color: 0 0 0 100; - rel1.offset: 2 2; - rel2.offset: -3 -3; + part { + name: "background"; + mouse_events: 0; + description { + state: "default" 0.0; + min: 50 50; + aspect: 1 1; + rel1 { + to: "overlay"; + } + rel2 { + to: "overlay"; + } + image { + normal: "e17_ibar_bg_h.png"; + border: 6 6 6 6; + } + fill { + smooth: 0; + } + } } - } - part { - name: "spectrum"; - type: SWALLOW; - mouse_events: 0; - description { - state: "default" 0.0; - min: 18 18; - max: 9999 9999; - rel1.to: "bg"; - rel1.offset: 1 1; - rel2.to: "bg"; - rel2.offset: -2 -2; + part { + name: "content_clip"; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + aspect: 1 1; + rel1 { + to: "background"; + offset: 4 4; + } + rel2 { + to: "background"; + offset: -5 -5; + } + color: 255 255 255 255; + } + } + part { + name: "content"; + type: SWALLOW; + mouse_events: 0; + clip_to: "content_clip"; + description { + state: "default" 0.0; + aspect: 1 1; + rel1 { + offset: 4 4; + } + rel2 { + offset: -5 -5; + } + color: 0 0 0 0; + } } - } part { name: "cursor"; type: RECT; dragable { - confine: "spectrum"; + confine: "content"; x: 1 1 0; y: 1 1 0; } description { state: "default" 0.0; - min: 3 3; - max: 3 3; + min: 1 1; + max: 1 1; fixed: 1 1; visible: 0; rel1 { - to: "spectrum"; + to: "content"; relative: 0.5 0.5; offset: 0 0; } rel2 { - to: "spectrum"; + to: "content"; relative: 0.5 0.5; offset: 0 0; } @@ -60,11 +95,11 @@ group { state: "default" 0.0; rel1 { to_x: "cursor"; - to_y: "spectrum"; + to_y: "content"; } rel2 { to_x: "cursor"; - to_y: "spectrum"; + to_y: "content"; } } @@ -75,15 +110,32 @@ group { description { state: "default" 0.0; rel1 { - to_x: "spectrum"; + to_x: "content"; to_y: "cursor"; } rel2 { - to_x: "spectrum"; + to_x: "content"; to_y: "cursor"; } } } + part { + name: "overlay"; + mouse_events: 0; + description { + state: "default" 0.0; + aspect: 1 1; + image { + normal: "e17_well_overlay.png"; + border: 13 13 13 13; + middle: 0; + } + fill { + smooth: 0; + } + } + } + } } diff --git a/data/themes/images/Makefile.am b/data/themes/images/Makefile.am index f1f1fa574..efec08fea 100644 --- a/data/themes/images/Makefile.am +++ b/data/themes/images/Makefile.am @@ -463,4 +463,5 @@ e17_busy-8.png \ e17_busy-9.png \ e17_wallpaper_center.png \ e17_wallpaper_screen.png \ -e17_wallpaper_center_flat.png +e17_wallpaper_center_flat.png \ +e17_well_overlay.png diff --git a/data/themes/images/e17_well_overlay.png b/data/themes/images/e17_well_overlay.png new file mode 100644 index 000000000..80109e5d9 Binary files /dev/null and b/data/themes/images/e17_well_overlay.png differ diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index c87acc0fe..5b80e89f0 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -171,6 +171,7 @@ e_spectrum.h \ e_widget_spectrum.h \ e_widget_cslider.h \ e_widget_csel.h \ +e_widget_color_well.h \ e_int_config_wallpaper.h \ e_int_config_wallpaper_import.h @@ -319,6 +320,7 @@ e_spectrum.c \ e_widget_spectrum.c \ e_widget_cslider.c \ e_widget_csel.c \ +e_widget_color_well.c \ e_int_config_wallpaper.c \ e_int_config_wallpaper_import.c \ $(ENLIGHTENMENTHEADERS) diff --git a/src/bin/e_includes.h b/src/bin/e_includes.h index a4ef2ac98..399323929 100644 --- a/src/bin/e_includes.h +++ b/src/bin/e_includes.h @@ -148,4 +148,5 @@ #include "e_spectrum.h" #include "e_widget_spectrum.h" #include "e_widget_cslider.h" +#include "e_widget_color_well.h" #include "e_widget_csel.h" diff --git a/src/bin/e_test.c b/src/bin/e_test.c index 85a2d15a9..b5858aa92 100644 --- a/src/bin/e_test.c +++ b/src/bin/e_test.c @@ -823,11 +823,12 @@ _e_test_internal(E_Container *con) e_dialog_content_set(dia, o, mw, mh); /* buttons at the bottom */ + e_dialog_button_add(dia, "Cancel", NULL, NULL, NULL); e_dialog_button_add(dia, "OK", NULL, NULL, NULL); e_dialog_resizable_set(dia, 1); e_win_centered_set(dia->win, 1); e_dialog_show(dia); - e_win_resize(dia->win, 460, 230); + e_win_resize(dia->win, 460, 260); } #else diff --git a/src/bin/e_widget_color_well.c b/src/bin/e_widget_color_well.c new file mode 100644 index 000000000..3fe80b3ac --- /dev/null +++ b/src/bin/e_widget_color_well.c @@ -0,0 +1,70 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ +#include "e.h" + +typedef struct _E_Widget_Data E_Widget_Data; +struct _E_Widget_Data +{ + Evas_Object *obj; + Evas_Object *o_edje; + Evas_Object *o_rect; + E_Color *color; +}; + +static void +_e_wid_update(E_Widget_Data *wd) +{ + if (!wd) return; + + evas_object_color_set(wd->o_rect, wd->color->r, wd->color->g, wd->color->b, wd->color->a); + e_widget_change(wd->obj); +} + +Evas_Object * +e_widget_color_well_add(Evas *evas, E_Color *color) +{ + Evas_Object *obj, *o; + Evas_Coord mw, mh; + E_Widget_Data *wd; + + obj = e_widget_add(evas); + + wd = calloc(1, sizeof(E_Widget_Data)); + e_widget_data_set(obj, wd); + wd->color = color; + wd->obj = obj; + + o = edje_object_add(evas); + e_widget_sub_object_add(obj, o); + e_widget_resize_object_set(obj, o); + e_theme_edje_object_set(o, "base/theme/widgets", + "widgets/color_well"); + + evas_object_show(o); + wd->o_edje = o; + + edje_object_size_min_calc(o, &mw, &mh); + e_widget_min_size_set(obj, mw, mh); + + o = evas_object_rectangle_add(evas); + e_widget_sub_object_add(obj, o); + evas_object_color_set(o, color->r, color->g, color->b, color->a); + edje_object_part_swallow(wd->o_edje, "content", o); + evas_object_show(o); + wd->o_rect = o; + + return obj; +} + +void +e_widget_color_well_update(Evas_Object *obj) +{ + E_Widget_Data *wd; + + wd = e_widget_data_get(obj); + _e_wid_update(wd); +} + + + diff --git a/src/bin/e_widget_color_well.h b/src/bin/e_widget_color_well.h new file mode 100644 index 000000000..ec6a17623 --- /dev/null +++ b/src/bin/e_widget_color_well.h @@ -0,0 +1,7 @@ +#ifndef E_WIDGET_COLOR_WELL_H +#define E_WIDGET_COLOR_WELL_H + +void e_widget_color_well_update(Evas_Object *obj); +Evas_Object *e_widget_color_well_add(Evas *evas, E_Color *color); + +#endif diff --git a/src/bin/e_widget_csel.c b/src/bin/e_widget_csel.c index 1126d207f..3d44b20a0 100644 --- a/src/bin/e_widget_csel.c +++ b/src/bin/e_widget_csel.c @@ -9,7 +9,7 @@ struct _E_Widget_Data Evas_Object *obj; Evas_List *sliders; Evas_List *entries; - Evas_Object *spectrum, *vert, *current; + Evas_Object *spectrum, *vert, *well; E_Color *cv; char **values; int mode; @@ -96,7 +96,7 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o) } } - // and update the sepctrum + // update the spectrum if (o != wd->spectrum && changed != -1) { if (wd->mode == changed || @@ -107,6 +107,8 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o) e_widget_spectrum_update(wd->spectrum, 0); } + e_widget_color_well_update(wd->well); + // now update the text fields to show current values for(l = wd->entries, i = 0; l; l = l->next, i++) { @@ -124,7 +126,7 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o) snprintf(buf, 10, "%i", wd->cv->b); break; case E_COLOR_COMPONENT_H: - snprintf(buf, 10, "%.2f", wd->cv->h); + snprintf(buf, 10, "%.0f", wd->cv->h); break; case E_COLOR_COMPONENT_S: snprintf(buf, 10, "%.2f", wd->cv->s); @@ -232,6 +234,13 @@ e_widget_csel_add(Evas *evas, E_Color *color) e_widget_table_object_append(table, frame, 3, 1, 1, 1, 1, 1, 1, 1); + o = e_widget_color_well_add(evas, cv); + e_widget_sub_object_add(obj, o); + evas_object_show(o); + wd->well = o; + e_widget_table_object_append(table, o, 3, 2, 1, 1, 1, 1, 1, 1); + + return obj; } diff --git a/src/bin/e_widget_cslider.c b/src/bin/e_widget_cslider.c index 47656c6ae..78707b8ce 100644 --- a/src/bin/e_widget_cslider.c +++ b/src/bin/e_widget_cslider.c @@ -86,7 +86,7 @@ e_widget_cslider_add(Evas *evas, E_Color_Component mode, E_Color *color, int ver evas_object_show(o); e_widget_sub_object_add(obj, o); wd->o_grad = o; - edje_object_part_swallow(wd->o_cslider, "gradient", o); + edje_object_part_swallow(wd->o_cslider, "content", o); evas_object_intercept_resize_callback_add(o, _e_wid_resize, wd); evas_object_intercept_move_callback_add(o, _e_wid_move, wd); _e_wid_update(wd); diff --git a/src/bin/e_widget_spectrum.c b/src/bin/e_widget_spectrum.c index 7e880480a..22aa6eb54 100644 --- a/src/bin/e_widget_spectrum.c +++ b/src/bin/e_widget_spectrum.c @@ -66,14 +66,13 @@ e_widget_spectrum_add(Evas *evas, E_Color_Component mode, E_Color *cv) evas_object_intercept_resize_callback_add(o, _e_wid_resize, wd); evas_object_intercept_move_callback_add(o, _e_wid_move, wd); - o = e_spectrum_add(evas); e_spectrum_color_value_set(o, cv); e_spectrum_mode_set(o, mode); e_widget_sub_object_add(obj, o); evas_object_show(o); wd->o_spectrum = o; - edje_object_part_swallow(wd->o_edje, "spectrum", o); + edje_object_part_swallow(wd->o_edje, "content", o); edje_extern_object_min_size_set(o, 100, 100); o = evas_object_rectangle_add(evas);