more csel work. theme it up a bit.

SVN revision: 24717
This commit is contained in:
rephorm 2006-08-15 00:54:33 +00:00 committed by rephorm
parent cfb5be331f
commit 4fa321e99b
15 changed files with 349 additions and 80 deletions

View File

@ -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) \

View File

@ -64,5 +64,6 @@ collections {
#include "default_preview.edc"
#include "default_cslider.edc"
#include "default_spectrum.edc"
#include "default_color_well.edc"
}

View File

@ -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;
}
}
}
}
}

View File

@ -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";
}
}
}

View File

@ -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;
}
}
}
}
}

View File

@ -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

Binary file not shown.

View File

@ -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)

View File

@ -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"

View File

@ -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

View File

@ -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);
}

View File

@ -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

View File

@ -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;
}

View File

@ -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);

View File

@ -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);