summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShobhit <s.parashari@samsung.com>2015-03-04 15:54:39 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-03-04 15:54:41 +0900
commit44369953dfc6a89fad5cbd870a956162fe7ec964 (patch)
treec54e46af2c7ab04750853c8d6a3cdf02d7e95317
parent91f49207576a105132821991bcc138c7d85c6dfb (diff)
hoversel: Enabled default mirroring in hoversel.
Removed default disable automatic mirroring of hoversel. Summary: Removed below API call for hoversel, hover, box and button object elm_widget_mirrored_automatic_set(obj, EINA_FALSE); Modified theme of "elm/button/base/hoversel_vertical_entry/default" to remove console errors due to theme, and modified text.align to -1 as 'x' value to set auto align for Arabic text. Modified example hoversel_example_01.c to illustrate mirroring functionality @fix Reviewers: Hermet, seoz, tasn Subscribers: sachin.dev Differential Revision: https://phab.enlightenment.org/D1910
-rw-r--r--data/themes/edc/elm/button.edc22
-rw-r--r--src/examples/hoversel_example_01.c41
-rw-r--r--src/lib/elc_hoversel.c5
3 files changed, 53 insertions, 15 deletions
diff --git a/data/themes/edc/elm/button.edc b/data/themes/edc/elm/button.edc
index 097ce857d..03c335658 100644
--- a/data/themes/edc/elm/button.edc
+++ b/data/themes/edc/elm/button.edc
@@ -837,7 +837,7 @@ group { name: "elm/button/base/hoversel_vertical/default";
837 } 837 }
838 desc { "visible"; 838 desc { "visible";
839 inherit: "default"; 839 inherit: "default";
840 rel1.offset: 2 5; 840 rel1.offset: 5 5;
841 text.min: 1 1; 841 text.min: 1 1;
842 text.ellipsis: -1; 842 text.ellipsis: -1;
843 visible: 1; 843 visible: 1;
@@ -852,7 +852,7 @@ group { name: "elm/button/base/hoversel_vertical/default";
852 } 852 }
853 desc { "disabled_visible"; 853 desc { "disabled_visible";
854 inherit: "default"; 854 inherit: "default";
855 rel1.offset: 2 5; 855 rel1.offset: 5 5;
856 color_class: "hoversel_text_disabled"; 856 color_class: "hoversel_text_disabled";
857 text.min: 1 1; 857 text.min: 1 1;
858 text.ellipsis: -1; 858 text.ellipsis: -1;
@@ -1085,21 +1085,27 @@ group { name: "elm/button/base/hoversel_vertical_entry/default";
1085 visible: 0; 1085 visible: 0;
1086 } 1086 }
1087 } 1087 }
1088 spacer { "text_container";
1089 desc { "default";
1090 rel1.relative: 1.0 0.0;
1091 rel1.to_x: "elm.swallow.content";
1092 rel1.to_y: "base";
1093 rel2.to: "base";
1094 }
1095 }
1088 text { "elm.text"; nomouse; 1096 text { "elm.text"; nomouse;
1089 effect: SHADOW BOTTOM; 1097 effect: SHADOW BOTTOM;
1090 scale: 1; 1098 scale: 1;
1091 clip_to: "click_clip"; 1099 clip_to: "click_clip";
1092 desc { "default"; 1100 desc { "default";
1093 rel1.offset: 0 5; 1101 rel1.offset: 0 5;
1094 rel1.relative: 1.0 0.0;
1095 rel1.to_x: "elm.swallow.content";
1096 rel1.to_y: "base";
1097 rel2.offset: -8 -8; 1102 rel2.offset: -8 -8;
1098 rel2.to: "base"; 1103 rel1.to: "text_container";
1104 rel2.to: "text_container";
1099 color_class: "hoversel_text"; 1105 color_class: "hoversel_text";
1100 color3: 255 255 255 255; 1106 color3: 255 255 255 255;
1101 text { font: FN; size: 10; 1107 text { font: FN; size: 10;
1102 align: 0.0 0.5; 1108 align: -1 0.5;
1103 min: 0 0; 1109 min: 0 0;
1104 text_class: "button"; 1110 text_class: "button";
1105 } 1111 }
@@ -1148,7 +1154,7 @@ group { name: "elm/button/base/hoversel_vertical_entry/default";
1148 color3: 255 255 255 255; 1154 color3: 255 255 255 255;
1149 text { font: FN; size: 10; 1155 text { font: FN; size: 10;
1150 text_source: "elm.text"; 1156 text_source: "elm.text";
1151 align: 0.0 0.5; 1157 align: -1 0.5;
1152 text_class: "hoversel_item"; 1158 text_class: "hoversel_item";
1153 } 1159 }
1154 visible: 0; 1160 visible: 0;
diff --git a/src/examples/hoversel_example_01.c b/src/examples/hoversel_example_01.c
index 8020fc87b..2c6f70a8f 100644
--- a/src/examples/hoversel_example_01.c
+++ b/src/examples/hoversel_example_01.c
@@ -14,6 +14,26 @@ _clear_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
14 elm_hoversel_clear((Evas_Object *)data); 14 elm_hoversel_clear((Evas_Object *)data);
15} 15}
16 16
17static void
18_reverse_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
19{
20 if (!data) return;
21 elm_object_mirrored_set(data, !elm_object_mirrored_get (data));
22 printf("\nMirrored mode is now %s", elm_object_mirrored_get(data) ? "ON" : "OFF" );
23 fflush(stdout);
24}
25
26Eina_Bool is_eng = EINA_TRUE;
27static void
28_arabic_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
29{
30 if (!data) return;
31 is_eng = !is_eng;
32 elm_object_text_set(data, is_eng ?
33 "Enable Arabic for new items" :
34 "Enable English for new items");
35}
36
17EAPI_MAIN int 37EAPI_MAIN int
18elm_main(int argc, char **argv) 38elm_main(int argc, char **argv)
19{ 39{
@@ -50,6 +70,20 @@ elm_main(int argc, char **argv)
50 evas_object_move(btn, 10, 50); 70 evas_object_move(btn, 10, 50);
51 evas_object_show(btn); 71 evas_object_show(btn);
52 72
73 btn = elm_button_add(win);
74 elm_object_text_set(btn, "Change Mirror Mode");
75 evas_object_smart_callback_add(btn, "clicked", _reverse_btn_clicked_cb, hoversel);
76 evas_object_resize(btn, 180, 30);
77 evas_object_move(btn, 10, 90);
78 evas_object_show(btn);
79
80 btn = elm_button_add(win);
81 elm_object_text_set(btn, "Enable Arabic for new items");
82 evas_object_smart_callback_add(btn, "clicked", _arabic_btn_clicked_cb, btn);
83 evas_object_resize(btn, 180, 30);
84 evas_object_move(btn, 10, 130);
85 evas_object_show(btn);
86
53 evas_object_resize(win, 200, 300); 87 evas_object_resize(win, 200, 300);
54 evas_object_show(win); 88 evas_object_show(win);
55 89
@@ -74,10 +108,13 @@ static void
74_add_item(void *data, Evas_Object *obj, void *event_info) 108_add_item(void *data, Evas_Object *obj, void *event_info)
75{ 109{
76 static int num = 0; 110 static int num = 0;
77 char *str = malloc(sizeof(char) * 10); 111 char *str = malloc(sizeof(char) * 11);
78 Elm_Object_Item *hoversel_it; 112 Elm_Object_Item *hoversel_it;
79 113
80 snprintf(str, 10, "item %d", ++num); 114 if(is_eng)
115 snprintf(str, 11, "item %d", ++num);
116 else
117 snprintf(str, 11, "بند %d", ++num);
81 118
82 hoversel_it = elm_hoversel_item_add(obj, str, NULL, ELM_ICON_NONE, NULL, 119 hoversel_it = elm_hoversel_item_add(obj, str, NULL, ELM_ICON_NONE, NULL,
83 str); 120 str);
diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c
index cb93c4b21..f69fccbba 100644
--- a/src/lib/elc_hoversel.c
+++ b/src/lib/elc_hoversel.c
@@ -152,7 +152,6 @@ _activate(Evas_Object *obj)
152 152
153 sd->hover = elm_hover_add(sd->hover_parent); 153 sd->hover = elm_hover_add(sd->hover_parent);
154 elm_widget_sub_object_add(obj, sd->hover); 154 elm_widget_sub_object_add(obj, sd->hover);
155 elm_widget_mirrored_automatic_set(sd->hover, EINA_FALSE);
156 155
157 if (sd->horizontal) 156 if (sd->horizontal)
158 snprintf(buf, sizeof(buf), "hoversel_horizontal/%s", 157 snprintf(buf, sizeof(buf), "hoversel_horizontal/%s",
@@ -169,7 +168,6 @@ _activate(Evas_Object *obj)
169 168
170 /* hover's content */ 169 /* hover's content */
171 bx = elm_box_add(sd->hover); 170 bx = elm_box_add(sd->hover);
172 elm_widget_mirrored_automatic_set(bx, EINA_FALSE);
173 elm_box_homogeneous_set(bx, EINA_TRUE); 171 elm_box_homogeneous_set(bx, EINA_TRUE);
174 elm_box_horizontal_set(bx, sd->horizontal); 172 elm_box_horizontal_set(bx, sd->horizontal);
175 173
@@ -184,7 +182,6 @@ _activate(Evas_Object *obj)
184 { 182 {
185 ELM_HOVERSEL_ITEM_DATA_GET(eo_item, item); 183 ELM_HOVERSEL_ITEM_DATA_GET(eo_item, item);
186 VIEW(item) = bt = elm_button_add(bx); 184 VIEW(item) = bt = elm_button_add(bx);
187 elm_widget_mirrored_automatic_set(bt, EINA_FALSE);
188 elm_widget_mirrored_set(bt, elm_widget_mirrored_get(obj)); 185 elm_widget_mirrored_set(bt, elm_widget_mirrored_get(obj));
189 elm_object_style_set(bt, buf); 186 elm_object_style_set(bt, buf);
190 elm_object_text_set(bt, item->label); 187 elm_object_text_set(bt, item->label);
@@ -290,8 +287,6 @@ _elm_hoversel_evas_object_smart_add(Eo *obj, Elm_Hoversel_Data *_pd EINA_UNUSED)
290 eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); 287 eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
291 elm_widget_sub_object_parent_add(obj); 288 elm_widget_sub_object_parent_add(obj);
292 289
293 elm_widget_mirrored_automatic_set(obj, EINA_FALSE);
294
295 evas_object_smart_callback_add(obj, "clicked", _on_clicked, obj); 290 evas_object_smart_callback_add(obj, "clicked", _on_clicked, obj);
296 291
297 //What are you doing here? 292 //What are you doing here?