Enlightenment CVS committal Author : ningerso Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_widget.c Log Message: Fix issue with labels not updating on text set. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_widget.c,v retrieving revision 1.117 retrieving revision 1.118 diff -u -3 -r1.117 -r1.118 --- ewl_widget.c 4 Jan 2007 07:51:01 -0000 1.117 +++ ewl_widget.c 5 Jan 2007 08:18:26 -0000 1.118 @@ -879,13 +879,18 @@ DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); - DCHECK_PARAM_PTR("part", part); DCHECK_PARAM_PTR("text", text); DCHECK_TYPE("w", w, EWL_WIDGET_TYPE); if (!w->theme_object) DLEAVE_FUNCTION(DLEVEL_STABLE); + /* + * Fill in the default part to use when the key is NULL. + */ + if (!part || !*part) + part = ewl_theme_data_str_get(w, "textpart"); + edje_object_part_text_set(w->theme_object, part, text); edje_object_size_min_calc(w->theme_object, &nw, &nh); @@ -984,9 +989,7 @@ */ match->value = strdup( text ? text : "" ); - if (match->key) - ewl_widget_appearance_part_text_apply(w, match->key, - match->value); + ewl_widget_appearance_part_text_apply(w, match->key, match->value); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -1017,13 +1020,17 @@ if (w->theme_text.list) { if (w->theme_text.direct) { match = EWL_PAIR(w->theme_text.list); - if (strcmp(part, match->key)) + if (part != match->key && + (part && match->key && + strcmp(part, match->key))) match = NULL; } else { for (i = 0; i < w->theme_text.len; i++) { Ewl_Pair *current = w->theme_text.list[i]; - if (!strcmp(current->key, part)) { + if (part == match->key || + (part && match->key && + !strcmp(part, match->key))) { match = current; break; } @@ -2365,16 +2372,10 @@ */ if (w->theme_object && w->theme_text.list) { const char *key; - char *value, *part; - - /* - * Fill in the default part to use when the key is NULL. - */ - part = ewl_theme_data_str_get(w, "textpart"); + char *value; if (w->theme_text.direct) { key = EWL_PAIR(w->theme_text.list)->key; - if (!key) key = part; value = EWL_PAIR(w->theme_text.list)->value; ewl_widget_appearance_part_text_apply(w, key, value); @@ -2383,14 +2384,11 @@ int i; for (i = 0; i < w->theme_text.len; i++) { key = w->theme_text.list[i]->key; - if (!key) key = part; value = w->theme_text.list[i]->value; ewl_widget_appearance_part_text_apply(w, key, value); } } - - IF_FREE(part); } } ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs