summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHosang Kim <hosang12.kim@samsung.com>2020-01-23 09:03:08 -0500
committerMike Blumenkrantz <zmike@samsung.com>2020-01-23 09:34:37 -0500
commit0e2778f0ca7cee9b167513852e6d505d42684430 (patch)
tree1bbfbf586ab18f16ec25ea5c01fc5177c828a8b0
parent932ea7a70e41035273e75077142ba2b706d59a16 (diff)
efl_ui_layout: send theme signal when style is already updated.
Summary: If you run below code, text is invisible. ``` efl_add(EFL_UI_BUTTON_CLASS, box, efl_ui_widget_style_set(efl_added, "anchor"), efl_text_set(efl_added, "anchor style"), efl_pack_end(box, efl_added)); ``` But below code is working well. ``` efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "anchor style"), efl_ui_widget_style_set(efl_added, "anchor"), efl_pack_end(box, efl_added)); ``` Test Plan: run efl_ui_theme_example_01 Reviewers: zmike Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11118
-rw-r--r--src/lib/elementary/efl_ui_layout.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c
index 9ab1ab3a4a..3b6c50ba2a 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -551,6 +551,23 @@ _efl_ui_layout_theme_internal(Eo *obj, Efl_Ui_Layout_Data *sd, Elm_Widget_Smart_
551 return ret; 551 return ret;
552} 552}
553 553
554static void
555_deferred_signals_emit(Efl_Ui_Layout_Data *pd)
556{
557 do
558 {
559 Deferred_Version_Signal *dvs = eina_inarray_pop(pd->deferred_signals);
560
561 if (pd->version < dvs->version_threshold)
562 efl_layout_signal_emit(pd->obj, dvs->old_sig, "efl");
563 else
564 efl_layout_signal_emit(pd->obj, dvs->new_sig, "efl");
565 eina_stringshare_del(dvs->old_sig);
566 eina_stringshare_del(dvs->new_sig);
567 } while (eina_inarray_count(pd->deferred_signals));
568 ELM_SAFE_FREE(pd->deferred_signals, eina_inarray_free);
569}
570
554EOLIAN static Eina_Error 571EOLIAN static Eina_Error
555_efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd) 572_efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd)
556{ 573{
@@ -603,20 +620,8 @@ _efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd)
603 } 620 }
604 } 621 }
605 if (sd->deferred_signals) 622 if (sd->deferred_signals)
606 { 623 _deferred_signals_emit(sd);
607 do
608 {
609 Deferred_Version_Signal *dvs = eina_inarray_pop(sd->deferred_signals);
610 624
611 if (sd->version < dvs->version_threshold)
612 efl_layout_signal_emit(sd->obj, dvs->old_sig, "efl");
613 else
614 efl_layout_signal_emit(sd->obj, dvs->new_sig, "efl");
615 eina_stringshare_del(dvs->old_sig);
616 eina_stringshare_del(dvs->new_sig);
617 } while (eina_inarray_count(sd->deferred_signals));
618 ELM_SAFE_FREE(sd->deferred_signals, eina_inarray_free);
619 }
620 if (!version) 625 if (!version)
621 { 626 {
622 snprintf(buf, sizeof(buf), "%d%d", EFL_VERSION_MAJOR, EFL_VERSION_MINOR + (EFL_VERSION_MICRO == 99 ? 1 : 0)); 627 snprintf(buf, sizeof(buf), "%d%d", EFL_VERSION_MAJOR, EFL_VERSION_MINOR + (EFL_VERSION_MICRO == 99 ? 1 : 0));
@@ -2730,6 +2735,8 @@ _efl_ui_layout_base_efl_object_finalize(Eo *obj, Efl_Ui_Layout_Data *pd)
2730 /* handle case where subclass does not call into layout */ 2735 /* handle case where subclass does not call into layout */
2731 pd->needs_theme_apply = EINA_FALSE; 2736 pd->needs_theme_apply = EINA_FALSE;
2732 } 2737 }
2738 else if (pd->deferred_signals)
2739 _deferred_signals_emit(pd);
2733 efl_canvas_group_change(obj); 2740 efl_canvas_group_change(obj);
2734 2741
2735 Elm_Layout_Data *ld = efl_data_scope_safe_get(obj, ELM_LAYOUT_MIXIN); 2742 Elm_Layout_Data *ld = efl_data_scope_safe_get(obj, ELM_LAYOUT_MIXIN);