summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2011-10-27 14:16:31 +0000
committerTom Hacohen <tom@stosb.com>2011-10-27 14:16:31 +0000
commitc91bdfc4dff7db036699f98db5a02f8ae679bf11 (patch)
treedc1df52ce868eaaea7d040db672b284224c69098 /legacy
parentf4d9d94ea491ab137c6acac13f61e95d25a3f803 (diff)
Elm entry: support setting theme parts to non-scrollable entries.
Until now it was only possible for scrolled entries. This patch is by Hyoyoung Chang, which I adjusted to conform to my previous patch. SVN revision: 64436
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/src/lib/elm_entry.c47
1 files changed, 36 insertions, 11 deletions
diff --git a/legacy/elementary/src/lib/elm_entry.c b/legacy/elementary/src/lib/elm_entry.c
index ff10a2735a..1b1b36ab8f 100644
--- a/legacy/elementary/src/lib/elm_entry.c
+++ b/legacy/elementary/src/lib/elm_entry.c
@@ -786,7 +786,10 @@ _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content)
786 Evas_Object *edje; 786 Evas_Object *edje;
787 if ((!wd) || (!content)) return; 787 if ((!wd) || (!content)) return;
788 788
789 edje = elm_smart_scroller_edje_object_get(wd->scroller); 789 if (wd->scroll)
790 edje = elm_smart_scroller_edje_object_get(wd->scroller);
791 else
792 edje = wd->ent;
790 793
791 /* Delete the currently swallowed object */ 794 /* Delete the currently swallowed object */
792 { 795 {
@@ -818,7 +821,11 @@ _content_unset_hook(Evas_Object *obj, const char *part)
818 Evas_Object *content, *edje; 821 Evas_Object *content, *edje;
819 if (!wd) return NULL; 822 if (!wd) return NULL;
820 823
821 edje = elm_smart_scroller_edje_object_get(wd->scroller); 824 if (wd->scroll)
825 edje = elm_smart_scroller_edje_object_get(wd->scroller);
826 else
827 edje = wd->ent;
828
822 if (!strcmp(part, "elm.swallow.icon")) 829 if (!strcmp(part, "elm.swallow.icon"))
823 { 830 {
824 edje_object_signal_emit(edje, "elm,action,hide,icon", "elm"); 831 edje_object_signal_emit(edje, "elm,action,hide,icon", "elm");
@@ -848,7 +855,11 @@ _content_get_hook(const Evas_Object *obj, const char *part)
848 Evas_Object *content = NULL, *edje; 855 Evas_Object *content = NULL, *edje;
849 if (!wd) return NULL; 856 if (!wd) return NULL;
850 857
851 edje = elm_smart_scroller_edje_object_get(wd->scroller); 858 if (wd->scroll)
859 edje = elm_smart_scroller_edje_object_get(wd->scroller);
860 else
861 edje = wd->ent;
862
852 if (edje) 863 if (edje)
853 content = edje_object_part_swallow_get(edje, part); 864 content = edje_object_part_swallow_get(edje, part);
854 return content; 865 return content;
@@ -926,7 +937,11 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
926 Evas_Object *sub = event_info; 937 Evas_Object *sub = event_info;
927 Evas_Object *edje; 938 Evas_Object *edje;
928 939
929 edje = elm_smart_scroller_edje_object_get(wd->scroller); 940 if (wd->scroll)
941 edje = elm_smart_scroller_edje_object_get(wd->scroller);
942 else
943 edje = wd->ent;
944
930 if (sub == edje_object_part_swallow_get(edje, "elm.swallow.icon")) 945 if (sub == edje_object_part_swallow_get(edje, "elm.swallow.icon"))
931 { 946 {
932 edje_object_part_unswallow(edje, sub); 947 edje_object_part_unswallow(edje, sub);
@@ -2054,11 +2069,16 @@ _elm_entry_text_set(Evas_Object *obj, const char *item, const char *entry)
2054{ 2069{
2055 int len = 0; 2070 int len = 0;
2056 ELM_CHECK_WIDTYPE(obj, widtype); 2071 ELM_CHECK_WIDTYPE(obj, widtype);
2057 if (item && strcmp(item, "default")) return;
2058 Widget_Data *wd = elm_widget_data_get(obj); 2072 Widget_Data *wd = elm_widget_data_get(obj);
2059 if (!wd) return; 2073 if (!wd) return;
2060 evas_event_freeze(evas_object_evas_get(obj)); 2074 evas_event_freeze(evas_object_evas_get(obj));
2061 if (!entry) entry = ""; 2075 if (!entry) entry = "";
2076 if (item && strcmp(item, "default"))
2077 {
2078 edje_object_part_text_set(wd->ent, item, entry);
2079 return;
2080 }
2081
2062 if (wd->text) eina_stringshare_del(wd->text); 2082 if (wd->text) eina_stringshare_del(wd->text);
2063 wd->text = NULL; 2083 wd->text = NULL;
2064 wd->changed = EINA_TRUE; 2084 wd->changed = EINA_TRUE;
@@ -3154,9 +3174,12 @@ elm_entry_icon_visible_set(Evas_Object *obj, Eina_Bool setting)
3154 Widget_Data *wd = elm_widget_data_get(obj); 3174 Widget_Data *wd = elm_widget_data_get(obj);
3155 Evas_Object *edje; 3175 Evas_Object *edje;
3156 if (!wd) return; 3176 if (!wd) return;
3157 edje = elm_smart_scroller_edje_object_get(wd->scroller); 3177 if (wd->scroll)
3158 if (!edje_object_part_swallow_get(edje, "elm.swallow.icon")) return; 3178 edje = elm_smart_scroller_edje_object_get(wd->scroller);
3159 if (!edje) return; 3179 else
3180 edje = wd->ent;
3181
3182 if ((!edje) || (!edje_object_part_swallow_get(edje, "elm.swallow.icon"))) return;
3160 if (setting) 3183 if (setting)
3161 edje_object_signal_emit(edje, "elm,action,show,icon", "elm"); 3184 edje_object_signal_emit(edje, "elm,action,show,icon", "elm");
3162 else 3185 else
@@ -3193,10 +3216,12 @@ elm_entry_end_visible_set(Evas_Object *obj, Eina_Bool setting)
3193 Widget_Data *wd = elm_widget_data_get(obj); 3216 Widget_Data *wd = elm_widget_data_get(obj);
3194 Evas_Object *edje; 3217 Evas_Object *edje;
3195 if (!wd) return; 3218 if (!wd) return;
3196 edje = elm_smart_scroller_edje_object_get(wd->scroller); 3219 if (wd->scroll)
3197 if (!edje_object_part_swallow_get(edje, "elm.swallow.end")) return; 3220 edje = elm_smart_scroller_edje_object_get(wd->scroller);
3221 else
3222 edje = wd->ent;
3198 3223
3199 if (!edje) return; 3224 if ((!edje) || (!edje_object_part_swallow_get(edje, "elm.swallow.icon"))) return;
3200 if (setting) 3225 if (setting)
3201 edje_object_signal_emit(edje, "elm,action,show,end", "elm"); 3226 edje_object_signal_emit(edje, "elm,action,show,end", "elm");
3202 else 3227 else