summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/edje_externals/elm_fileselector_button.c
diff options
context:
space:
mode:
authorOtavio Pontes <otavio@profusion.mobi>2010-10-21 22:03:43 +0000
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2010-10-21 22:03:43 +0000
commitc11bf5692a9ca61033b1f46b7a3f00bee1e5c3cd (patch)
treeb98f93b8aeb00ebac7473ed173539b44dadddf97 /legacy/elementary/src/edje_externals/elm_fileselector_button.c
parentca157edc920772232ad42a01d4c37837a710b921 (diff)
Add support for changing style from one elm widget in edje external.
Create a param 'style' that can be used in edje external to change the style of one object. Patch by: Otavio Pontes <otavio@profusion.mobi> SVN revision: 53754
Diffstat (limited to 'legacy/elementary/src/edje_externals/elm_fileselector_button.c')
-rw-r--r--legacy/elementary/src/edje_externals/elm_fileselector_button.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/legacy/elementary/src/edje_externals/elm_fileselector_button.c b/legacy/elementary/src/edje_externals/elm_fileselector_button.c
index 72e869c..4bdc1b2 100644
--- a/legacy/elementary/src/edje_externals/elm_fileselector_button.c
+++ b/legacy/elementary/src/edje_externals/elm_fileselector_button.c
@@ -3,6 +3,7 @@
3typedef struct _Elm_Params_fileselector_button 3typedef struct _Elm_Params_fileselector_button
4{ 4{
5 Elm_Params base; 5 Elm_Params base;
6 const char *label;
6 Evas_Object *icon; 7 Evas_Object *icon;
7 8
8 struct { 9 struct {
@@ -27,8 +28,8 @@ external_fileselector_button_state_set(void *data __UNUSED__, Evas_Object *obj,
27 else if (from_params) p = from_params; 28 else if (from_params) p = from_params;
28 else return; 29 else return;
29 30
30 if (p->base.label) 31 if (p->label)
31 elm_fileselector_button_label_set(obj, p->base.label); 32 elm_fileselector_button_label_set(obj, p->label);
32 if (p->icon) elm_fileselector_button_icon_set(obj, p->icon); 33 if (p->icon) elm_fileselector_button_icon_set(obj, p->icon);
33 if (p->fs.path) elm_fileselector_button_path_set(obj, p->fs.path); 34 if (p->fs.path) elm_fileselector_button_path_set(obj, p->fs.path);
34 if (p->fs.is_save_set) 35 if (p->fs.is_save_set)
@@ -179,8 +180,7 @@ external_fileselector_button_params_parse(void *data, Evas_Object *obj, const Ei
179 Edje_External_Param *param; 180 Edje_External_Param *param;
180 const Eina_List *l; 181 const Eina_List *l;
181 182
182 mem = external_common_params_parse(Elm_Params_fileselector_button, 183 mem = calloc(1, sizeof(Elm_Params_fileselector_button));
183 data, obj, params);
184 if (!mem) 184 if (!mem)
185 return NULL; 185 return NULL;
186 186
@@ -210,6 +210,8 @@ external_fileselector_button_params_parse(void *data, Evas_Object *obj, const Ei
210 mem->fs.inwin_mode = !!param->i; 210 mem->fs.inwin_mode = !!param->i;
211 mem->fs.inwin_mode_set = EINA_TRUE; 211 mem->fs.inwin_mode_set = EINA_TRUE;
212 } 212 }
213 else if (!strcmp(param->name, "label"))
214 mem->label = eina_stringshare_add(param->s);
213 } 215 }
214 216
215 return mem; 217 return mem;
@@ -229,11 +231,14 @@ external_fileselector_button_params_free(void *params)
229 231
230 if (mem->fs.path) 232 if (mem->fs.path)
231 eina_stringshare_del(mem->fs.path); 233 eina_stringshare_del(mem->fs.path);
232 external_common_params_free(params); 234 if (mem->label)
235 eina_stringshare_del(mem->label);
236 free(params);
233} 237}
234 238
235static Edje_External_Param_Info external_fileselector_button_params[] = { 239static Edje_External_Param_Info external_fileselector_button_params[] = {
236 DEFINE_EXTERNAL_COMMON_PARAMS, 240 DEFINE_EXTERNAL_COMMON_PARAMS,
241 EDJE_EXTERNAL_PARAM_INFO_STRING("label"),
237 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"), 242 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"),
238 EDJE_EXTERNAL_PARAM_INFO_STRING("path"), 243 EDJE_EXTERNAL_PARAM_INFO_STRING("path"),
239 EDJE_EXTERNAL_PARAM_INFO_BOOL("save"), 244 EDJE_EXTERNAL_PARAM_INFO_BOOL("save"),