summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSungtaek Hong <sth253.hong@samsung.com>2016-09-20 16:07:18 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-09-20 16:07:21 -0700
commit03882d558824f657f5c5a54fcd2d632eafeafd87 (patch)
tree9079c745d794763a8c129b3309174d825c58f24e /src
parent2cc7be3743890b3c25ebf69a9ee4aa839d366827 (diff)
elm_progressbar: show status when unit_format_func is set
Summary: - elm,state,units,visible signal is emitted only when unit is set, but not when unit_format_func is set. - Since default unit has been set, this signal is emitted but signal will not be emitted after unit is set to NULL. Test Plan: 1. Create a progressbar. 2. elm_progressbar_unit_format_set(obj, NULL); 3. set unit_format_func by elm_progressbar_unit_format_function_set() and observe elm.text.status part visible. Reviewers: Hermet, jpeg, cedric Reviewed By: cedric Subscribers: D-TAU, eunue, conr2d, cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4210 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/elm_progressbar.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/lib/elementary/elm_progressbar.c b/src/lib/elementary/elm_progressbar.c
index e8d4beaf89..57f33bb64a 100644
--- a/src/lib/elementary/elm_progressbar.c
+++ b/src/lib/elementary/elm_progressbar.c
@@ -211,7 +211,7 @@ _elm_progressbar_elm_widget_theme_apply(Eo *obj, Elm_Progressbar_Data *sd)
211 if (sd->pulse_state) 211 if (sd->pulse_state)
212 elm_layout_signal_emit(obj, "elm,state,pulse,start", "elm"); 212 elm_layout_signal_emit(obj, "elm,state,pulse,start", "elm");
213 213
214 if ((sd->units) && (!sd->pulse)) 214 if (((sd->units) || (sd->unit_format_func)) && (!sd->pulse))
215 elm_layout_signal_emit(obj, "elm,state,units,visible", "elm"); 215 elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
216 216
217 if (_is_horizontal(sd->orientation)) 217 if (_is_horizontal(sd->orientation))
@@ -439,19 +439,13 @@ _elm_progressbar_efl_ui_progress_progress_value_get(Eo *obj EINA_UNUSED, Elm_Pro
439EOLIAN static void 439EOLIAN static void
440_elm_progressbar_efl_ui_progress_unit_format_set(Eo *obj, Elm_Progressbar_Data *sd, const char *units) 440_elm_progressbar_efl_ui_progress_unit_format_set(Eo *obj, Elm_Progressbar_Data *sd, const char *units)
441{ 441{
442 const char *sig;
442 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 443 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
443 444
444 eina_stringshare_replace(&sd->units, units); 445 eina_stringshare_replace(&sd->units, units);
445 if (units) 446 sig = (units) ? "elm,state,units,visible" : "elm,state,units,hidden";
446 { 447 elm_layout_signal_emit(obj, sig, "elm");
447 elm_layout_signal_emit(obj, "elm,state,units,visible", "elm"); 448 edje_object_message_signal_process(wd->resize_obj);
448 edje_object_message_signal_process(wd->resize_obj);
449 }
450 else
451 {
452 elm_layout_signal_emit(obj, "elm,state,units,hidden", "elm");
453 edje_object_message_signal_process(wd->resize_obj);
454 }
455 449
456 _units_set(obj); 450 _units_set(obj);
457 elm_layout_sizing_eval(obj); 451 elm_layout_sizing_eval(obj);
@@ -572,10 +566,15 @@ elm_progressbar_unit_format_get(const Elm_Progressbar *obj)
572EAPI void 566EAPI void
573elm_progressbar_unit_format_function_set(Elm_Progressbar *obj, progressbar_func_type func, progressbar_freefunc_type free_func) 567elm_progressbar_unit_format_function_set(Elm_Progressbar *obj, progressbar_func_type func, progressbar_freefunc_type free_func)
574{ 568{
569 const char *sig;
575 ELM_PROGRESSBAR_DATA_GET(obj, sd); 570 ELM_PROGRESSBAR_DATA_GET(obj, sd);
571 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
576 572
577 sd->unit_format_func = func; 573 sd->unit_format_func = func;
578 sd->unit_format_free = free_func; 574 sd->unit_format_free = free_func;
575 sig = (func) ? "elm,state,units,visible" : "elm,state,units,hidden";
576 elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
577 edje_object_message_signal_process(wd->resize_obj);
579 578
580 _units_set(obj); 579 _units_set(obj);
581 elm_layout_sizing_eval(obj); 580 elm_layout_sizing_eval(obj);