summaryrefslogtreecommitdiff
path: root/src/edje_externals/elm_check.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2010-03-25 20:17:34 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2010-03-25 20:17:34 +0000
commit6ef61679ab19774d634867cc8f499393006e1841 (patch)
tree36fcbc888981812da83d465f36d55380418596a1 /src/edje_externals/elm_check.c
parent475b875f38f3f44e2be1a4e1a0f4643bbb16c0fe (diff)
Simplify state_set and just apply values that were explicitly set.
SVN revision: 47458
Diffstat (limited to 'src/edje_externals/elm_check.c')
-rw-r--r--src/edje_externals/elm_check.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/edje_externals/elm_check.c b/src/edje_externals/elm_check.c
index cfa3ab65f..2fb331e40 100644
--- a/src/edje_externals/elm_check.c
+++ b/src/edje_externals/elm_check.c
@@ -4,28 +4,25 @@ typedef struct _Elm_Params_Check
4{ 4{
5 Elm_Params base; 5 Elm_Params base;
6 Evas_Object *icon; 6 Evas_Object *icon;
7 int state; 7 Eina_Bool state:1;
8 Eina_Bool state_exists:1;
8} Elm_Params_Check; 9} Elm_Params_Check;
9 10
10static void 11static void
11external_check_state_set(void *data __UNUSED__, Evas_Object *obj, const void *from_params, const void *to_params, float pos __UNUSED__) 12external_check_state_set(void *data __UNUSED__, Evas_Object *obj, const void *from_params, const void *to_params, float pos __UNUSED__)
12{ 13{
13 const Elm_Params_Check *p1 = from_params, *p2 = to_params; 14 const Elm_Params_Check *p;
14 15
15 p1 = from_params; 16 if (to_params) p = to_params;
16 p2 = to_params; 17 else if (from_params) p = from_params;
17 18 else return;
18 if (!p2) 19
19 { 20 if (p->base.label)
20 elm_check_label_set(obj, p1->base.label); 21 elm_check_label_set(obj, p->base.label);
21 elm_check_icon_set(obj, p1->icon); 22 if (p->icon)
22 elm_check_state_set(obj, p1->state); 23 elm_check_icon_set(obj, p->icon);
23 return; 24 if (p->state_exists)
24 } 25 elm_check_state_set(obj, p->state);
25
26 elm_check_label_set(obj, p2->base.label);
27 elm_check_icon_set(obj, p2->icon);
28 elm_check_state_set(obj, p2->state);
29} 26}
30 27
31static Eina_Bool 28static Eina_Bool
@@ -111,7 +108,10 @@ external_check_params_parse(void *data, Evas_Object *obj, const Eina_List *param
111 108
112 param = edje_external_param_find(params, "state"); 109 param = edje_external_param_find(params, "state");
113 if (param) 110 if (param)
114 mem->state = param->i; 111 {
112 mem->state = !!param->i;
113 mem->state_exists = EINA_TRUE;
114 }
115 115
116 return mem; 116 return mem;
117} 117}