summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVyacheslav Reutskiy <v.reutskiy@samsung.com>2013-12-19 15:42:23 +0900
committerCedric BAIL <cedric.bail@samsung.com>2013-12-19 15:53:29 +0900
commitbf3f0f2f4a61fc1a0ffd04c16053caeebd9dc30d (patch)
tree031fee40d16f0fa3e665eb1bb180979e32e1a131 /src
parent811c97eabb72f001d0cdb971c5cd9df54700b39c (diff)
edje: edje_edit - fix edje_edit_state_color_class_set to apply the colors to color_class.
edje_edit_state_color_class_set apply the colors from color_class to the given part. Reviewers: cedric, seoz, raster Reviewed By: cedric CC: cedric Differential Revision: https://phab.enlightenment.org/D391 Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/edje/edje_edit.c38
1 files changed, 32 insertions, 6 deletions
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index edf558f138..f38cf44b1a 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -3877,14 +3877,40 @@ edje_edit_state_color_class_get(Evas_Object *obj, const char *part, const char *
3877EAPI Eina_Bool 3877EAPI Eina_Bool
3878edje_edit_state_color_class_set(Evas_Object *obj, const char *part, const char *state, double value, const char *color_class) 3878edje_edit_state_color_class_set(Evas_Object *obj, const char *part, const char *state, double value, const char *color_class)
3879{ 3879{
3880 if ((!obj) || (!part) || (!state)) 3880 Eina_List *l;
3881 return EINA_FALSE; 3881 Edje_Color_Class *cc;
3882 GET_PD_OR_RETURN(EINA_FALSE);
3883 3882
3884 _edje_if_string_free(ed, pd->color_class); 3883 if ((!obj) || (!part) || (!state)) return EINA_FALSE;
3884 GET_PD_OR_RETURN(EINA_FALSE);
3885 3885
3886 pd->color_class = (char *)eina_stringshare_add(color_class); 3886 if (!ed->file->color_classes) return EINA_FALSE;
3887 return EINA_TRUE; 3887 EINA_LIST_FOREACH(ed->file->color_classes, l, cc)
3888 {
3889 if (strcmp(cc->name, color_class) == 0)
3890 {
3891 pd->color.r = cc->r;
3892 pd->color.g = cc->g;
3893 pd->color.b = cc->b;
3894 pd->color.a = cc->a;
3895 pd->color2.r = cc->r2;
3896 pd->color2.g = cc->g2;
3897 pd->color2.b = cc->b2;
3898 pd->color2.a = cc->a2;
3899 if ((rp->type == EDJE_PART_TYPE_TEXT) || (rp->type == EDJE_PART_TYPE_TEXTBLOCK))
3900 {
3901 Edje_Part_Description_Text *txt = (Edje_Part_Description_Text *)pd;
3902 txt->text.color3.r = cc->r3;
3903 txt->text.color3.g = cc->g3;
3904 txt->text.color3.b = cc->b3;
3905 txt->text.color3.a = cc->a3;
3906 }
3907 pd->color_class = (char *)eina_stringshare_add(color_class);
3908 edje_object_calc_force(obj);
3909 return EINA_TRUE;
3910 }
3911 }
3912 pd->color_class = NULL;
3913 return EINA_FALSE;
3888} 3914}
3889 3915
3890EAPI const Eina_List * 3916EAPI const Eina_List *