summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--legacy/elementary/src/lib/elm_entry.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/legacy/elementary/src/lib/elm_entry.c b/legacy/elementary/src/lib/elm_entry.c
index 75395d85fa..ff10a2735a 100644
--- a/legacy/elementary/src/lib/elm_entry.c
+++ b/legacy/elementary/src/lib/elm_entry.c
@@ -19,7 +19,7 @@ typedef struct _Elm_Entry_Text_Filter Elm_Entry_Text_Filter;
19 19
20struct _Widget_Data 20struct _Widget_Data
21{ 21{
22 Evas_Object *ent, *scroller, *end, *icon; 22 Evas_Object *ent, *scroller;
23 Evas_Object *hoversel; 23 Evas_Object *hoversel;
24 Ecore_Job *deferred_recalc_job; 24 Ecore_Job *deferred_recalc_job;
25 Ecore_Event_Handler *sel_notify_handler; 25 Ecore_Event_Handler *sel_notify_handler;
@@ -787,18 +787,20 @@ _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content)
787 if ((!wd) || (!content)) return; 787 if ((!wd) || (!content)) return;
788 788
789 edje = elm_smart_scroller_edje_object_get(wd->scroller); 789 edje = elm_smart_scroller_edje_object_get(wd->scroller);
790
791 /* Delete the currently swallowed object */
792 {
793 Evas_Object *cswallow = edje_object_part_swallow_get(edje, part);
794 if (cswallow)
795 evas_object_del(cswallow);
796 }
797
790 if (!strcmp(part, "elm.swallow.icon")) 798 if (!strcmp(part, "elm.swallow.icon"))
791 { 799 {
792 if (wd->icon)
793 evas_object_del(wd->icon);
794 wd->icon = content;
795 edje_object_signal_emit(edje, "elm,action,show,icon", "elm"); 800 edje_object_signal_emit(edje, "elm,action,show,icon", "elm");
796 } 801 }
797 else if (!strcmp(part, "elm.swallow.end")) 802 else if (!strcmp(part, "elm.swallow.end"))
798 { 803 {
799 if (wd->end)
800 evas_object_del(wd->end);
801 wd->end = content;
802 edje_object_signal_emit(edje, "elm,action,show,end", "elm"); 804 edje_object_signal_emit(edje, "elm,action,show,end", "elm");
803 } 805 }
804 evas_event_freeze(evas_object_evas_get(obj)); 806 evas_event_freeze(evas_object_evas_get(obj));
@@ -819,12 +821,10 @@ _content_unset_hook(Evas_Object *obj, const char *part)
819 edje = elm_smart_scroller_edje_object_get(wd->scroller); 821 edje = elm_smart_scroller_edje_object_get(wd->scroller);
820 if (!strcmp(part, "elm.swallow.icon")) 822 if (!strcmp(part, "elm.swallow.icon"))
821 { 823 {
822 wd->icon = NULL;
823 edje_object_signal_emit(edje, "elm,action,hide,icon", "elm"); 824 edje_object_signal_emit(edje, "elm,action,hide,icon", "elm");
824 } 825 }
825 else if (!strcmp(part, "elm.swallow.end")) 826 else if (!strcmp(part, "elm.swallow.end"))
826 { 827 {
827 wd->end = NULL;
828 edje_object_signal_emit(edje, "elm,action,hide,end", "elm"); 828 edje_object_signal_emit(edje, "elm,action,hide,end", "elm");
829 } 829 }
830 830
@@ -848,11 +848,6 @@ _content_get_hook(const Evas_Object *obj, const char *part)
848 Evas_Object *content = NULL, *edje; 848 Evas_Object *content = NULL, *edje;
849 if (!wd) return NULL; 849 if (!wd) return NULL;
850 850
851 if (!strcmp(part, "elm.swallow.icon"))
852 return wd->icon;
853 if (!strcmp(part, "elm.swallow.end"))
854 return wd->end;
855
856 edje = elm_smart_scroller_edje_object_get(wd->scroller); 851 edje = elm_smart_scroller_edje_object_get(wd->scroller);
857 if (edje) 852 if (edje)
858 content = edje_object_part_swallow_get(edje, part); 853 content = edje_object_part_swallow_get(edje, part);
@@ -932,15 +927,15 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
932 Evas_Object *edje; 927 Evas_Object *edje;
933 928
934 edje = elm_smart_scroller_edje_object_get(wd->scroller); 929 edje = elm_smart_scroller_edje_object_get(wd->scroller);
935 if (sub == wd->icon) 930 if (sub == edje_object_part_swallow_get(edje, "elm.swallow.icon"))
936 { 931 {
937 wd->icon = NULL; 932 edje_object_part_unswallow(edje, sub);
938 if (edje) 933 if (edje)
939 edje_object_signal_emit(edje, "elm,action,hide,icon", "elm"); 934 edje_object_signal_emit(edje, "elm,action,hide,icon", "elm");
940 } 935 }
941 else if (sub == wd->end) 936 else if (sub == edje_object_part_swallow_get(edje, "elm.swallow.end"))
942 { 937 {
943 wd->end = NULL; 938 edje_object_part_unswallow(edje, sub);
944 if (edje) 939 if (edje)
945 edje_object_signal_emit(edje, "elm,action,hide,end", "elm"); 940 edje_object_signal_emit(edje, "elm,action,hide,end", "elm");
946 } 941 }
@@ -3158,8 +3153,9 @@ elm_entry_icon_visible_set(Evas_Object *obj, Eina_Bool setting)
3158 ELM_CHECK_WIDTYPE(obj, widtype); 3153 ELM_CHECK_WIDTYPE(obj, widtype);
3159 Widget_Data *wd = elm_widget_data_get(obj); 3154 Widget_Data *wd = elm_widget_data_get(obj);
3160 Evas_Object *edje; 3155 Evas_Object *edje;
3161 if ((!wd) || (!wd->icon)) return; 3156 if (!wd) return;
3162 edje = elm_smart_scroller_edje_object_get(wd->scroller); 3157 edje = elm_smart_scroller_edje_object_get(wd->scroller);
3158 if (!edje_object_part_swallow_get(edje, "elm.swallow.icon")) return;
3163 if (!edje) return; 3159 if (!edje) return;
3164 if (setting) 3160 if (setting)
3165 edje_object_signal_emit(edje, "elm,action,show,icon", "elm"); 3161 edje_object_signal_emit(edje, "elm,action,show,icon", "elm");
@@ -3196,8 +3192,10 @@ elm_entry_end_visible_set(Evas_Object *obj, Eina_Bool setting)
3196 ELM_CHECK_WIDTYPE(obj, widtype); 3192 ELM_CHECK_WIDTYPE(obj, widtype);
3197 Widget_Data *wd = elm_widget_data_get(obj); 3193 Widget_Data *wd = elm_widget_data_get(obj);
3198 Evas_Object *edje; 3194 Evas_Object *edje;
3199 if ((!wd) || (!wd->end)) return; 3195 if (!wd) return;
3200 edje = elm_smart_scroller_edje_object_get(wd->scroller); 3196 edje = elm_smart_scroller_edje_object_get(wd->scroller);
3197 if (!edje_object_part_swallow_get(edje, "elm.swallow.end")) return;
3198
3201 if (!edje) return; 3199 if (!edje) return;
3202 if (setting) 3200 if (setting)
3203 edje_object_signal_emit(edje, "elm,action,show,end", "elm"); 3201 edje_object_signal_emit(edje, "elm,action,show,end", "elm");