summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJee-Yong Um <jc9.um@samsung.com>2016-03-04 15:39:29 -0800
committerCedric BAIL <cedric@osg.samsung.com>2016-03-04 16:14:37 -0800
commitddf416c66189ef1f458d537bb1e2cbf5fa70567f (patch)
tree2f84f13d2e76761f9222aea89e7509cea6dfb253
parent859f31102e9b4d776a144872a4b839cc509a9628 (diff)
fileselector: refine code and theme
Summary: refine code and theme, hopefully solve the issue that the height of file list (genlist) is calculated wrong. Test Plan: elementary_test -to fileselector Reviewers: SanghyeonLee, jpeg, cedric Subscribers: taxi2se Differential Revision: https://phab.enlightenment.org/D3715 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--data/themes/edc/elm/fileselector.edc173
-rw-r--r--src/lib/elc_fileselector.c191
-rw-r--r--src/lib/elm_fileselector.eo1
3 files changed, 166 insertions, 199 deletions
diff --git a/data/themes/edc/elm/fileselector.edc b/data/themes/edc/elm/fileselector.edc
index 0e1fa5034..de639b755 100644
--- a/data/themes/edc/elm/fileselector.edc
+++ b/data/themes/edc/elm/fileselector.edc
@@ -1,8 +1,8 @@
1group { name: "elm/entry/path/separator/default"; 1group { name: "elm/entry/path/separator/default";
2 images.image: "sym_right_glow_normal.png" COMP; 2 images.image: "sym_right_glow_normal.png" COMP;
3 parts { 3 parts {
4 part { name: "icon"; mouse_events: 0; 4 image { "icon"; nomouse;
5 description { state: "default" 0.0; 5 desc { "default";
6 image.normal: "sym_right_glow_normal.png"; 6 image.normal: "sym_right_glow_normal.png";
7 FIXED_SIZE(15, 15) 7 FIXED_SIZE(15, 15)
8 aspect: 1.0 1.0; 8 aspect: 1.0 1.0;
@@ -14,21 +14,17 @@ group { name: "elm/entry/path/separator/default";
14group { name: "elm/fileselector/base/default"; 14group { name: "elm/fileselector/base/default";
15 data.item: "path_separator" "<item relsize=15x15 vsize=full href=path/separator></item>"; 15 data.item: "path_separator" "<item relsize=15x15 vsize=full href=path/separator></item>";
16 parts { 16 parts {
17 part { name: "elm.swallow.up"; type: SWALLOW; 17 swallow { "elm.swallow.up";
18 description { state: "default" 0.0; 18 desc { "default";
19 fixed: 1 1;
20 align: 0.0 0.0; 19 align: 0.0 0.0;
21 min: 5 5;
22 rel1.offset: 3 3; 20 rel1.offset: 3 3;
23 rel2.relative: 0.0 0.0; 21 rel2.relative: 0.0 0.0;
24 rel2.offset: 3 3; 22 rel2.offset: 3 3;
25 } 23 }
26 } 24 }
27 part { name: "elm.swallow.home"; type: SWALLOW; 25 swallow { "elm.swallow.home";
28 description { state: "default" 0.0; 26 desc { "default";
29 fixed: 1 1; 27 align: 0.0 0.5;
30 align: 0.0 0.0;
31 min: 5 5;
32 rel1 { 28 rel1 {
33 to: "elm.swallow.up"; 29 to: "elm.swallow.up";
34 relative: 1.0 0.0; 30 relative: 1.0 0.0;
@@ -41,9 +37,9 @@ group { name: "elm/fileselector/base/default";
41 } 37 }
42 } 38 }
43 } 39 }
44 part { name: "elm.swallow.search"; type: SWALLOW; 40 swallow { "elm.swallow.search";
45 description { state: "default" 0.0; 41 desc { "default";
46 fixed: 1 1; 42 min: 65 0;
47 rel1 { 43 rel1 {
48 to: "elm.swallow.home"; 44 to: "elm.swallow.home";
49 relative: 1.0 0.0; 45 relative: 1.0 0.0;
@@ -52,121 +48,114 @@ group { name: "elm/fileselector/base/default";
52 rel2 { 48 rel2 {
53 to_y: "elm.swallow.home"; 49 to_y: "elm.swallow.home";
54 relative: 1.0 1.0; 50 relative: 1.0 1.0;
55 offset: -4 0; 51 offset: -4 -1;
56 } 52 }
57 } 53 }
58 } 54 }
59 part { name: "elm.spinner.clip"; type: RECT; 55 swallow { "elm.swallow.ok";
60 description { state: "default" 0.0; 56 description { state: "default" 0.0;
61 rel1.to: "elm.swallow.spinner"; 57 align: 1.0 1.0;
62 rel2.to: "elm.swallow.spinner"; 58 rel1.relative: 1.0 1.0;
63 color: 255 255 255 0; 59 rel1.offset: -4 -4;
64 } 60 rel2.relative: 1.0 1.0;
65 description { state: "visible" 0.0; 61 rel2.offset: -4 -4;
66 inherit: "default" 0.0;
67 color: 255 255 255 255;
68 } 62 }
69 } 63 }
70 part { name: "elm.swallow.spinner"; type: SWALLOW; 64 swallow { "elm.swallow.cancel";
71 clip_to: "elm.spinner.clip"; 65 desc { "default";
72 description { state: "default" 0.0; 66 align: 1.0 0.5;
73 fixed: 1 1; 67 rel1 {
74 align: 1.0 0.0; 68 to: "elm.swallow.ok";
75 min: 5 5; 69 relative: 0.0 0.0;
76 rel1.relative: 1.0 0.0; 70 offset: -4 0;
77 rel1.offset: -4 3; 71 }
78 rel2.relative: 1.0 0.0; 72 rel2 {
79 rel2.offset: -4 3; 73 to: "elm.swallow.ok";
74 relative: 0.0 1.0;
75 offset: -4 -1;
76 }
80 } 77 }
81 } 78 }
82 part { name: "elm.swallow.files"; type: SWALLOW; 79 swallow { "elm.swallow.filters";
83 description { state: "default" 0.0; 80 desc { "default";
84 align: 1.0 0.0; 81 align: 1.0 1.0;
85 min: 10 10;
86 rel1 { 82 rel1 {
87 to_y: "elm.swallow.home"; 83 to_y: "elm.swallow.ok";
88 relative: 0.0 1.0; 84 relative: 1.0 0.0;
89 offset: 3 3; 85 offset: -4 -4;
90 } 86 }
91 rel2 { 87 rel2 {
92 to_y: "elm.swallow.path"; 88 to_y: "elm.swallow.ok";
93 relative: 1.0 0.0; 89 relative: 1.0 0.0;
94 offset: -4 -4; 90 offset: -4 -4;
95 } 91 }
96 } 92 }
97 } 93 }
98 part { name: "elm.swallow.path"; type: SWALLOW; 94 swallow { "elm.swallow.filename";
99 description { state: "default" 0.0; 95 desc { "default";
100 fixed: 1 1;
101 align: 0.5 1.0; 96 align: 0.5 1.0;
102 rel1 { 97 rel1 {
103 to_y: "elm.swallow.filename"; 98 to_y: "elm.swallow.filters";
104 relative: 0.0 0.0; 99 relative: 0.0 0.0;
105 offset: 3 -4; 100 offset: 3 -4;
106 } 101 }
107 rel2 { 102 rel2 {
108 to_y: "elm.swallow.filename"; 103 to_y: "elm.swallow.filters";
109 relative: 1.0 0.0; 104 relative: 1.0 0.0;
110 offset: -4 -4; 105 offset: -4 -4;
111 } 106 }
112 } 107 }
113 } 108 }
114 part { name: "elm.swallow.filename"; type: SWALLOW; 109 swallow { "elm.swallow.path";
115 description { state: "default" 0.0; 110 desc { "default";
116 fixed: 1 1;
117 align: 0.5 1.0; 111 align: 0.5 1.0;
118 rel1 { 112 rel1 {
119 to_y: "elm.swallow.filters"; 113 to_y: "elm.swallow.filename";
120 relative: 0.0 0.0; 114 relative: 0.0 0.0;
121 offset: 3 -4; 115 offset: 3 -4;
122 } 116 }
123 rel2 { 117 rel2 {
124 to_y: "elm.swallow.filters"; 118 to_y: "elm.swallow.filename";
125 relative: 1.0 0.0; 119 relative: 1.0 0.0;
126 offset: -4 -4; 120 offset: -4 -4;
127 } 121 }
128 } 122 }
129 } 123 }
130 part { name: "elm.swallow.filters"; type: SWALLOW; 124 swallow { "elm.swallow.files";
131 description { state: "default" 0.0; 125 desc { "default";
132 fixed: 1 1;
133 align: 1.0 1.0;
134 rel1 { 126 rel1 {
135 to_y: "elm.swallow.ok"; 127 to_y: "elm.swallow.home";
136 relative: 1.0 0.0; 128 relative: 0.0 1.0;
137 offset: -4 -4; 129 offset: 3 3;
138 } 130 }
139 rel2 { 131 rel2 {
140 to_y: "elm.swallow.ok"; 132 to_y: "elm.swallow.path";
141 relative: 1.0 0.0; 133 relative: 1.0 0.0;
142 offset: -4 -4; 134 offset: -4 -4;
143 } 135 }
144 } 136 }
145 } 137 }
146 part { name: "elm.swallow.cancel"; type: SWALLOW; 138 swallow { "elm.swallow.spinner";
147 description { state: "default" 0.0; 139 clip: "elm.spinner.clip";
140 desc { "default";
148 fixed: 1 1; 141 fixed: 1 1;
149 align: 1.0 1.0; 142 align: 1.0 0.0;
150 rel1 { 143 rel1.relative: 1.0 0.0;
151 to: "elm.swallow.ok"; 144 rel1.offset: -4 3;
152 relative: 0.0 0.0; 145 rel2.relative: 1.0 0.0;
153 offset: -4 0; 146 rel2.offset: -4 3;
154 }
155 rel2 {
156 to: "elm.swallow.ok";
157 relative: 0.0 1.0;
158 offset: -4 -1;
159 }
160 } 147 }
161 } 148 }
162 part { name: "elm.swallow.ok"; type: SWALLOW; 149 rect { "elm.spinner.clip";
163 description { state: "default" 0.0; 150 desc { "default";
164 fixed: 1 1; 151 fixed: 1 1;
165 align: 1.0 1.0; 152 rel1.to: "elm.swallow.spinner";
166 rel1.relative: 1.0 1.0; 153 rel2.to: "elm.swallow.spinner";
167 rel1.offset: -4 -4; 154 color: 255 255 255 0;
168 rel2.relative: 1.0 1.0; 155 }
169 rel2.offset: -4 -4; 156 desc { "visible";
157 inherit: "default" 0.0;
158 color: 255 255 255 255;
170 } 159 }
171 } 160 }
172 } 161 }
@@ -194,20 +183,8 @@ group { name: "elm/fileselector/base/default";
194 183
195group { name: "elm/fileselector_entry/base/default"; 184group { name: "elm/fileselector_entry/base/default";
196 parts { 185 parts {
197 part { name: "elm.swallow.entry"; type: SWALLOW; 186 swallow { "elm.swallow.button"; scale;
198 scale: 1; 187 desc { "default";
199 description { state: "default" 0.0;
200 align: 0.0 0.5;
201 min: 50 4;
202 rel2 { to_x: "elm.swallow.button";
203 relative: 0.0 1.0;
204 offset: -1 -1;
205 }
206 }
207 }
208 part { name: "elm.swallow.button"; type: SWALLOW;
209 scale: 1;
210 description { state: "default" 0.0;
211 align: 1.0 0.0; 188 align: 1.0 0.0;
212 fixed: 1 0; 189 fixed: 1 0;
213 min: 40 4; 190 min: 40 4;
@@ -217,5 +194,15 @@ group { name: "elm/fileselector_entry/base/default";
217 } 194 }
218 } 195 }
219 } 196 }
197 swallow { "elm.swallow.entry"; scale;
198 desc { "default";
199 align: 0.0 0.5;
200 min: 50 4;
201 rel2 { to_x: "elm.swallow.button";
202 relative: 0.0 1.0;
203 offset: -1 -1;
204 }
205 }
206 }
220 } 207 }
221} 208}
diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c
index 7fef6072b..5dd263c59 100644
--- a/src/lib/elc_fileselector.c
+++ b/src/lib/elc_fileselector.c
@@ -74,19 +74,6 @@ _elm_fileselector_smart_del_do(Elm_Fileselector_Data *sd)
74 evas_obj_smart_del(eo_super(sd->obj, MY_CLASS)); 74 evas_obj_smart_del(eo_super(sd->obj, MY_CLASS));
75} 75}
76 76
77EOLIAN static void
78_elm_fileselector_elm_layout_sizing_eval(Eo *obj, Elm_Fileselector_Data *sd EINA_UNUSED)
79{
80 Evas_Coord minw = -1, minh = -1;
81
82 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
83
84 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
85 edje_object_size_min_restricted_calc
86 (wd->resize_obj, &minw, &minh, minw, minh);
87 evas_object_size_hint_min_set(obj, minw, minh);
88}
89
90static void 77static void
91_mirrored_set(Evas_Object *obj, Eina_Bool rtl) 78_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
92{ 79{
@@ -105,16 +92,16 @@ _elm_fileselector_elm_widget_theme_apply(Eo *obj, Elm_Fileselector_Data *sd)
105 const char *style; 92 const char *style;
106 const char *data; 93 const char *data;
107 char buf[1024]; 94 char buf[1024];
108
109 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
110
111 Eina_Bool int_ret = EINA_FALSE; 95 Eina_Bool int_ret = EINA_FALSE;
96
112 int_ret = elm_obj_widget_theme_apply(eo_super(obj, MY_CLASS)); 97 int_ret = elm_obj_widget_theme_apply(eo_super(obj, MY_CLASS));
113 if (!int_ret) return EINA_FALSE; 98 if (!int_ret) return EINA_FALSE;
114 99
115 style = elm_widget_style_get(obj); 100 style = elm_widget_style_get(obj);
116 _mirrored_set(obj, elm_widget_mirrored_get(obj)); 101 _mirrored_set(obj, elm_widget_mirrored_get(obj));
117 102
103 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
104
118 data = edje_object_data_get 105 data = edje_object_data_get
119 (wd->resize_obj, "path_separator"); 106 (wd->resize_obj, "path_separator");
120 if (data) sd->path_separator = data; 107 if (data) sd->path_separator = data;
@@ -122,36 +109,24 @@ _elm_fileselector_elm_widget_theme_apply(Eo *obj, Elm_Fileselector_Data *sd)
122 109
123 snprintf(buf, sizeof(buf), "fileselector/%s", style); 110 snprintf(buf, sizeof(buf), "fileselector/%s", style);
124 111
125#define SWALLOW(part_name, object_ptn) \ 112 elm_widget_style_set(sd->up_button, buf);
126 if (object_ptn) \ 113 elm_widget_style_set(sd->home_button, buf);
127 { \ 114 elm_widget_style_set(sd->spinner, "wheel");
128 elm_widget_style_set(object_ptn, buf); \
129 if (!elm_layout_content_set(obj, part_name, object_ptn)) \
130 evas_object_hide(object_ptn); \
131 }
132
133 SWALLOW("elm.swallow.up", sd->up_button);
134 SWALLOW("elm.swallow.home", sd->home_button);
135 SWALLOW("elm.swallow.spinner", sd->spinner);
136 elm_object_style_set(sd->spinner, "wheel");
137 115
138 if (!elm_layout_content_set(obj, "elm.swallow.files", sd->files_view)) 116 elm_widget_style_set(sd->path_entry, buf);
139 evas_object_hide(sd->files_view); 117 elm_widget_style_set(sd->name_entry, buf);
140 118 elm_widget_style_set(sd->search_entry, buf);
141 SWALLOW("elm.swallow.path", sd->path_entry);
142 SWALLOW("elm.swallow.filename", sd->name_entry);
143 SWALLOW("elm.swallow.search", sd->search_entry);
144 119
145 snprintf(buf, sizeof(buf), "fileselector/actions/%s", style); 120 snprintf(buf, sizeof(buf), "fileselector/actions/%s", style);
146 SWALLOW("elm.swallow.filters", sd->filter_hoversel);
147 SWALLOW("elm.swallow.cancel", sd->cancel_button);
148 SWALLOW("elm.swallow.ok", sd->ok_button);
149
150#undef SWALLOW
151 121
152 edje_object_message_signal_process(wd->resize_obj); 122 if (sd->filter_hoversel)
123 elm_widget_style_set(sd->filter_hoversel, buf);
153 124
154 elm_layout_sizing_eval(obj); 125 if (sd->ok_button)
126 {
127 elm_widget_style_set(sd->cancel_button, buf);
128 elm_widget_style_set(sd->ok_button, buf);
129 }
155 130
156 return EINA_TRUE; 131 return EINA_TRUE;
157} 132}
@@ -1266,9 +1241,6 @@ _files_list_add(Evas_Object *obj)
1266 li = elm_genlist_add(obj); 1241 li = elm_genlist_add(obj);
1267 evas_object_data_set(li, "parent", obj); 1242 evas_object_data_set(li, "parent", obj);
1268 elm_widget_mirrored_automatic_set(li, EINA_FALSE); 1243 elm_widget_mirrored_automatic_set(li, EINA_FALSE);
1269 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
1270 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1271 evas_object_size_hint_min_set(li, 100, 100);
1272 1244
1273 eo_event_callback_add 1245 eo_event_callback_add
1274 (li, EVAS_SELECTABLE_INTERFACE_EVENT_SELECTED, _on_item_selected, obj); 1246 (li, EVAS_SELECTABLE_INTERFACE_EVENT_SELECTED, _on_item_selected, obj);
@@ -1287,8 +1259,6 @@ _files_list_add(Evas_Object *obj)
1287 eo_event_callback_add 1259 eo_event_callback_add
1288 (li, EVAS_OBJECT_EVENT_KEY_DOWN, _files_key_down, obj); 1260 (li, EVAS_OBJECT_EVENT_KEY_DOWN, _files_key_down, obj);
1289 1261
1290 elm_widget_sub_object_add(obj, li);
1291
1292 return li; 1262 return li;
1293} 1263}
1294 1264
@@ -1318,8 +1288,6 @@ _files_grid_add(Evas_Object *obj)
1318 eo_event_callback_add 1288 eo_event_callback_add
1319 (grid, EVAS_OBJECT_EVENT_KEY_DOWN, _files_key_down, obj); 1289 (grid, EVAS_OBJECT_EVENT_KEY_DOWN, _files_key_down, obj);
1320 1290
1321 elm_widget_sub_object_add(obj, grid);
1322
1323 return grid; 1291 return grid;
1324} 1292}
1325 1293
@@ -1471,8 +1439,8 @@ EOLIAN static void
1471_elm_fileselector_evas_object_smart_add(Eo *obj, Elm_Fileselector_Data *priv) 1439_elm_fileselector_evas_object_smart_add(Eo *obj, Elm_Fileselector_Data *priv)
1472{ 1440{
1473 Evas_Object *ic, *bt, *en, *pb; 1441 Evas_Object *ic, *bt, *en, *pb;
1474 1442 const char *data;
1475 EINA_REFCOUNT_INIT(priv); 1443 char buf[1024];
1476 1444
1477 evas_obj_smart_add(eo_super(obj, MY_CLASS)); 1445 evas_obj_smart_add(eo_super(obj, MY_CLASS));
1478 elm_widget_sub_object_parent_add(obj); 1446 elm_widget_sub_object_parent_add(obj);
@@ -1485,40 +1453,70 @@ _elm_fileselector_evas_object_smart_add(Eo *obj, Elm_Fileselector_Data *priv)
1485 (obj, "fileselector", "base", elm_widget_style_get(obj))) 1453 (obj, "fileselector", "base", elm_widget_style_get(obj)))
1486 CRI("Failed to set layout!"); 1454 CRI("Failed to set layout!");
1487 1455
1456 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1457
1458 data = edje_object_data_get
1459 (wd->resize_obj, "path_separator");
1460 if (data) priv->path_separator = data;
1461 else priv->path_separator = "/";
1462
1463 snprintf(buf, sizeof(buf), "fileselector/%s", elm_widget_style_get(obj));
1464
1488 // up btn 1465 // up btn
1489 ic = elm_icon_add(obj); 1466 ic = elm_icon_add(obj);
1490 elm_icon_standard_set(ic, "arrow_up"); 1467 elm_icon_standard_set(ic, "arrow_up");
1491 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
1492 bt = elm_button_add(obj); 1468 bt = elm_button_add(obj);
1493 elm_widget_mirrored_automatic_set(bt, EINA_FALSE); 1469 elm_widget_mirrored_automatic_set(bt, EINA_FALSE);
1494 elm_object_part_content_set(bt, "icon", ic); 1470 elm_object_part_content_set(bt, "icon", ic);
1495 elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Up")); 1471 elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Up"));
1496 evas_object_size_hint_align_set(bt, 0.0, 0.0);
1497 eo_event_callback_add 1472 eo_event_callback_add
1498 (bt, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _on_dir_up, obj); 1473 (bt, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _on_dir_up, obj);
1499 1474
1500 elm_widget_sub_object_add(obj, bt);
1501
1502 priv->up_button = bt; 1475 priv->up_button = bt;
1476 elm_object_style_set(priv->up_button, buf);
1477 elm_object_part_content_set(obj, "elm.swallow.up", priv->up_button);
1503 1478
1504 // home btn 1479 // home btn
1505 ic = elm_icon_add(obj); 1480 ic = elm_icon_add(obj);
1506 elm_icon_standard_set(ic, "home"); 1481 elm_icon_standard_set(ic, "home");
1507 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
1508 bt = elm_button_add(obj); 1482 bt = elm_button_add(obj);
1509 elm_widget_mirrored_automatic_set(bt, EINA_FALSE); 1483 elm_widget_mirrored_automatic_set(bt, EINA_FALSE);
1510 elm_object_part_content_set(bt, "icon", ic); 1484 elm_object_part_content_set(bt, "icon", ic);
1511 elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Home")); 1485 elm_object_domain_translatable_text_set(bt, PACKAGE, N_("Home"));
1512 evas_object_size_hint_align_set(bt, 0.0, 0.0);
1513 eo_event_callback_add 1486 eo_event_callback_add
1514 (bt, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _home, obj); 1487 (bt, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _home, obj);
1515 1488
1516 priv->home_button = bt; 1489 priv->home_button = bt;
1490 elm_object_style_set(priv->home_button, buf);
1491 elm_object_part_content_set(obj, "elm.swallow.home", priv->home_button);
1492
1493 // search entry
1494 ic = elm_icon_add(obj);
1495 elm_icon_standard_set(ic, "search");
1496 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
1497 en = elm_entry_add(obj);
1498 elm_entry_scrollable_set(en, EINA_TRUE);
1499 elm_widget_mirrored_automatic_set(en, EINA_FALSE);
1500 elm_entry_editable_set(en, EINA_TRUE);
1501 elm_entry_single_line_set(en, EINA_TRUE);
1502 elm_entry_line_wrap_set(en, ELM_WRAP_CHAR);
1503 elm_object_domain_translatable_part_text_set(en, "guide",
1504 PACKAGE, N_("Search"));
1505 elm_object_part_content_set(en, "icon", ic);
1506 elm_entry_icon_visible_set(en, EINA_TRUE);
1507 eo_event_callback_add
1508 (en, ELM_ENTRY_EVENT_CHANGED, _preedit_cb, obj);
1509 evas_object_data_set(obj, "search", en);
1510
1511 priv->search_entry = en;
1512 elm_object_style_set(priv->search_entry, buf);
1513 elm_object_part_content_set(obj, "elm.swallow.search", priv->search_entry);
1517 1514
1518 // spinner 1515 // spinner
1519 pb = elm_progressbar_add(obj); 1516 pb = elm_progressbar_add(obj);
1520 elm_widget_sub_object_add(obj, pb);
1521 priv->spinner = pb; 1517 priv->spinner = pb;
1518 elm_object_style_set(priv->spinner, "wheel");
1519 elm_object_part_content_set(obj, "elm.swallow.spinner", priv->spinner);
1522 1520
1523 // XXX: will fail for dynamic finger size changing 1521 // XXX: will fail for dynamic finger size changing
1524 priv->thumbnail_size.w = elm_config_finger_size_get() * 2 - GENGRID_PADDING; 1522 priv->thumbnail_size.w = elm_config_finger_size_get() * 2 - GENGRID_PADDING;
@@ -1527,17 +1525,12 @@ _elm_fileselector_evas_object_smart_add(Eo *obj, Elm_Fileselector_Data *priv)
1527 priv->sort_type = ELM_FILESELECTOR_SORT_BY_FILENAME_ASC; 1525 priv->sort_type = ELM_FILESELECTOR_SORT_BY_FILENAME_ASC;
1528 priv->sort_method = strcoll; 1526 priv->sort_method = strcoll;
1529 1527
1530 // files_view
1531 priv->files_view = _files_list_add(obj);
1532
1533 // path entry 1528 // path entry
1534 en = elm_entry_add(obj); 1529 en = elm_entry_add(obj);
1535 elm_entry_scrollable_set(en, EINA_TRUE); 1530 elm_entry_scrollable_set(en, EINA_TRUE);
1536 elm_widget_mirrored_automatic_set(en, EINA_FALSE); 1531 elm_widget_mirrored_automatic_set(en, EINA_FALSE);
1537 elm_entry_single_line_set(en, EINA_TRUE); 1532 elm_entry_single_line_set(en, EINA_TRUE);
1538 elm_entry_line_wrap_set(en, ELM_WRAP_CHAR); 1533 elm_entry_line_wrap_set(en, ELM_WRAP_CHAR);
1539 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1540 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1541 1534
1542 eo_event_callback_add 1535 eo_event_callback_add
1543 (en, ELM_ENTRY_EVENT_ANCHOR_CLICKED, _anchor_clicked, obj); 1536 (en, ELM_ENTRY_EVENT_ANCHOR_CLICKED, _anchor_clicked, obj);
@@ -1548,8 +1541,9 @@ _elm_fileselector_evas_object_smart_add(Eo *obj, Elm_Fileselector_Data *priv)
1548 eo_event_callback_add 1541 eo_event_callback_add
1549 (en, ELM_ENTRY_EVENT_ACTIVATED, _on_text_activated, obj); 1542 (en, ELM_ENTRY_EVENT_ACTIVATED, _on_text_activated, obj);
1550 1543
1551 elm_widget_sub_object_add(obj, en);
1552 priv->path_entry = en; 1544 priv->path_entry = en;
1545 elm_object_style_set(priv->path_entry, buf);
1546 elm_object_part_content_set(obj, "elm.swallow.path", priv->path_entry);
1553 1547
1554 // name entry 1548 // name entry
1555 en = elm_entry_add(obj); 1549 en = elm_entry_add(obj);
@@ -1558,38 +1552,19 @@ _elm_fileselector_evas_object_smart_add(Eo *obj, Elm_Fileselector_Data *priv)
1558 elm_entry_editable_set(en, EINA_TRUE); 1552 elm_entry_editable_set(en, EINA_TRUE);
1559 elm_entry_single_line_set(en, EINA_TRUE); 1553 elm_entry_single_line_set(en, EINA_TRUE);
1560 elm_entry_line_wrap_set(en, ELM_WRAP_CHAR); 1554 elm_entry_line_wrap_set(en, ELM_WRAP_CHAR);
1561 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1562 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1563 1555
1564 elm_widget_sub_object_add(obj, en);
1565 priv->name_entry = en; 1556 priv->name_entry = en;
1557 elm_object_style_set(priv->name_entry, buf);
1558 elm_object_part_content_set(obj, "elm.swallow.filename", priv->name_entry);
1566 1559
1567 //search entry 1560 // ok cancel button
1568 ic = elm_icon_add(obj);
1569 elm_icon_standard_set(ic, "search");
1570 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
1571 en = elm_entry_add(obj);
1572 elm_entry_scrollable_set(en, EINA_TRUE);
1573 elm_widget_mirrored_automatic_set(en, EINA_FALSE);
1574 elm_entry_editable_set(en, EINA_TRUE);
1575 elm_entry_single_line_set(en, EINA_TRUE);
1576 elm_entry_line_wrap_set(en, ELM_WRAP_CHAR);
1577 elm_object_domain_translatable_part_text_set(en, "guide",
1578 PACKAGE, N_("Search"));
1579 elm_object_part_content_set(en, "icon", ic);
1580 elm_entry_icon_visible_set(en, EINA_TRUE);
1581 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1582 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
1583 eo_event_callback_add
1584 (en, ELM_ENTRY_EVENT_CHANGED, _preedit_cb, obj);
1585 evas_object_data_set(obj, "search", en);
1586
1587 elm_widget_sub_object_add(obj, en);
1588 priv->search_entry = en;
1589
1590 elm_fileselector_buttons_ok_cancel_set(obj, EINA_TRUE); 1561 elm_fileselector_buttons_ok_cancel_set(obj, EINA_TRUE);
1591 elm_fileselector_is_save_set(obj, EINA_FALSE); 1562 elm_fileselector_is_save_set(obj, EINA_FALSE);
1592 1563
1564 // files_view
1565 priv->files_view = _files_list_add(obj);
1566 elm_object_part_content_set(obj, "elm.swallow.files", priv->files_view);
1567
1593#define HANDLER_ADD(e, fn) \ 1568#define HANDLER_ADD(e, fn) \
1594 priv->handlers = eina_list_append(priv->handlers, \ 1569 priv->handlers = eina_list_append(priv->handlers, \
1595 ecore_event_handler_add(e, fn, obj)); 1570 ecore_event_handler_add(e, fn, obj));
@@ -1601,7 +1576,7 @@ _elm_fileselector_evas_object_smart_add(Eo *obj, Elm_Fileselector_Data *priv)
1601 HANDLER_ADD(EIO_MONITOR_DIRECTORY_DELETED, _resource_deleted); 1576 HANDLER_ADD(EIO_MONITOR_DIRECTORY_DELETED, _resource_deleted);
1602#undef HANDLER_ADD 1577#undef HANDLER_ADD
1603 1578
1604 elm_obj_widget_theme_apply(obj); 1579 elm_obj_layout_sizing_eval(obj);
1605} 1580}
1606 1581
1607EOLIAN static void 1582EOLIAN static void
@@ -1737,8 +1712,14 @@ EOLIAN static void
1737_elm_fileselector_buttons_ok_cancel_set(Eo *obj, Elm_Fileselector_Data *sd, Eina_Bool visible) 1712_elm_fileselector_buttons_ok_cancel_set(Eo *obj, Elm_Fileselector_Data *sd, Eina_Bool visible)
1738{ 1713{
1739 Evas_Object *bt; 1714 Evas_Object *bt;
1715 Eina_Bool bt_exists = EINA_FALSE;
1740 1716
1741 if (visible && (!sd->ok_button)) 1717 visible = !!visible;
1718 bt_exists = !!sd->ok_button;
1719
1720 if (!(visible ^ bt_exists)) return;
1721
1722 if (visible)
1742 { 1723 {
1743 // cancel btn 1724 // cancel btn
1744 bt = elm_button_add(obj); 1725 bt = elm_button_add(obj);
@@ -1749,6 +1730,7 @@ _elm_fileselector_buttons_ok_cancel_set(Eo *obj, Elm_Fileselector_Data *sd, Eina
1749 (bt, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _canc, obj); 1730 (bt, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _canc, obj);
1750 1731
1751 sd->cancel_button = bt; 1732 sd->cancel_button = bt;
1733 elm_object_part_content_set(obj, "elm.swallow.cancel", sd->cancel_button);
1752 1734
1753 // ok btn 1735 // ok btn
1754 bt = elm_button_add(obj); 1736 bt = elm_button_add(obj);
@@ -1759,10 +1741,9 @@ _elm_fileselector_buttons_ok_cancel_set(Eo *obj, Elm_Fileselector_Data *sd, Eina
1759 (bt, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _ok, obj); 1741 (bt, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _ok, obj);
1760 1742
1761 sd->ok_button = bt; 1743 sd->ok_button = bt;
1762 1744 elm_object_part_content_set(obj, "elm.swallow.ok", sd->ok_button);
1763 elm_obj_widget_theme_apply(obj);
1764 } 1745 }
1765 else if (!visible) 1746 else
1766 { 1747 {
1767 ELM_SAFE_FREE(sd->cancel_button, evas_object_del); 1748 ELM_SAFE_FREE(sd->cancel_button, evas_object_del);
1768 ELM_SAFE_FREE(sd->ok_button, evas_object_del); 1749 ELM_SAFE_FREE(sd->ok_button, evas_object_del);
@@ -2117,7 +2098,7 @@ EOLIAN static Eina_Bool
2117_elm_fileselector_elm_interface_fileselector_mime_types_filter_append(Eo *obj, Elm_Fileselector_Data *sd, const char *mime_types, const char *filter_name) 2098_elm_fileselector_elm_interface_fileselector_mime_types_filter_append(Eo *obj, Elm_Fileselector_Data *sd, const char *mime_types, const char *filter_name)
2118{ 2099{
2119 Elm_Fileselector_Filter *ff; 2100 Elm_Fileselector_Filter *ff;
2120 Eina_Bool need_theme = EINA_FALSE; 2101 char buf[1024];
2121 2102
2122 if (!mime_types) return EINA_FALSE; 2103 if (!mime_types) return EINA_FALSE;
2123 2104
@@ -2133,7 +2114,9 @@ _elm_fileselector_elm_interface_fileselector_mime_types_filter_append(Eo *obj, E
2133 sd->current_filter = ff; 2114 sd->current_filter = ff;
2134 sd->filter_hoversel = elm_hoversel_add(obj); 2115 sd->filter_hoversel = elm_hoversel_add(obj);
2135 elm_object_text_set(sd->filter_hoversel, ff->filter_name); 2116 elm_object_text_set(sd->filter_hoversel, ff->filter_name);
2136 need_theme = EINA_TRUE; 2117 snprintf(buf, sizeof(buf), "fileselector/actions/%s", elm_widget_style_get(obj));
2118 elm_widget_style_set(sd->filter_hoversel, buf);
2119 elm_object_part_content_set(obj, "elm.swallow.filters", sd->filter_hoversel);
2137 } 2120 }
2138 elm_hoversel_item_add(sd->filter_hoversel, ff->filter_name, NULL, ELM_ICON_NONE, _current_filter_changed, ff); 2121 elm_hoversel_item_add(sd->filter_hoversel, ff->filter_name, NULL, ELM_ICON_NONE, _current_filter_changed, ff);
2139 2122
@@ -2145,9 +2128,6 @@ _elm_fileselector_elm_interface_fileselector_mime_types_filter_append(Eo *obj, E
2145 _schedule_populate(obj, sd, sd->path, NULL); 2128 _schedule_populate(obj, sd, sd->path, NULL);
2146 } 2129 }
2147 2130
2148 if (need_theme)
2149 elm_obj_widget_theme_apply(obj);
2150
2151 return EINA_TRUE; 2131 return EINA_TRUE;
2152} 2132}
2153 2133
@@ -2165,7 +2145,7 @@ _elm_fileselector_elm_interface_fileselector_custom_filter_append(Eo *obj, Elm_F
2165{ 2145{
2166 Elm_Fileselector_Filter *ff; 2146 Elm_Fileselector_Filter *ff;
2167 Elm_Fileselector_Custom_Filter *custom_filter; 2147 Elm_Fileselector_Custom_Filter *custom_filter;
2168 Eina_Bool need_theme = EINA_FALSE; 2148 char buf[1024];
2169 2149
2170 if (!func) return EINA_FALSE; 2150 if (!func) return EINA_FALSE;
2171 2151
@@ -2189,7 +2169,9 @@ _elm_fileselector_elm_interface_fileselector_custom_filter_append(Eo *obj, Elm_F
2189 sd->current_filter = ff; 2169 sd->current_filter = ff;
2190 sd->filter_hoversel = elm_hoversel_add(obj); 2170 sd->filter_hoversel = elm_hoversel_add(obj);
2191 elm_object_text_set(sd->filter_hoversel, ff->filter_name); 2171 elm_object_text_set(sd->filter_hoversel, ff->filter_name);
2192 need_theme = EINA_TRUE; 2172 snprintf(buf, sizeof(buf), "fileselector/actions/%s", elm_widget_style_get(obj));
2173 elm_widget_style_set(sd->filter_hoversel, buf);
2174 elm_object_part_content_set(obj, "elm.swallow.filters", sd->filter_hoversel);
2193 } 2175 }
2194 elm_hoversel_item_add(sd->filter_hoversel, ff->filter_name, NULL, ELM_ICON_NONE, _current_filter_changed, ff); 2176 elm_hoversel_item_add(sd->filter_hoversel, ff->filter_name, NULL, ELM_ICON_NONE, _current_filter_changed, ff);
2195 2177
@@ -2201,9 +2183,6 @@ _elm_fileselector_elm_interface_fileselector_custom_filter_append(Eo *obj, Elm_F
2201 _schedule_populate(obj, sd, sd->path, NULL); 2183 _schedule_populate(obj, sd, sd->path, NULL);
2202 } 2184 }
2203 2185
2204 if (need_theme)
2205 elm_obj_widget_theme_apply(obj);
2206
2207 return EINA_TRUE; 2186 return EINA_TRUE;
2208} 2187}
2209 2188
@@ -2410,8 +2389,9 @@ _elm_fileselector_elm_widget_focus_next(Eo *obj EINA_UNUSED, Elm_Fileselector_Da
2410 if (sd->files_view) items = eina_list_append(items, sd->files_view); 2389 if (sd->files_view) items = eina_list_append(items, sd->files_view);
2411 if (sd->path_entry) items = eina_list_append(items, sd->path_entry); 2390 if (sd->path_entry) items = eina_list_append(items, sd->path_entry);
2412 if (sd->name_entry) items = eina_list_append(items, sd->name_entry); 2391 if (sd->name_entry) items = eina_list_append(items, sd->name_entry);
2392 if (sd->filter_hoversel) items = eina_list_append(items, sd->filter_hoversel);
2413 if (sd->cancel_button) items = eina_list_append(items, sd->cancel_button); 2393 if (sd->cancel_button) items = eina_list_append(items, sd->cancel_button);
2414 if (sd->ok_button) items = eina_list_append(items, sd->ok_button); 2394 if (sd->ok_button) items = eina_list_append(items, sd->ok_button);
2415 2395
2416 if (_elm_config->access_mode) 2396 if (_elm_config->access_mode)
2417 return elm_widget_focus_list_next_get(obj, items, eina_list_data_get, dir, next, next_item); 2397 return elm_widget_focus_list_next_get(obj, items, eina_list_data_get, dir, next, next_item);
@@ -2440,6 +2420,7 @@ _elm_fileselector_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Fileselect
2440 if (sd->files_view) items = eina_list_append(items, sd->files_view); 2420 if (sd->files_view) items = eina_list_append(items, sd->files_view);
2441 if (sd->path_entry) items = eina_list_append(items, sd->path_entry); 2421 if (sd->path_entry) items = eina_list_append(items, sd->path_entry);
2442 if (sd->name_entry) items = eina_list_append(items, sd->name_entry); 2422 if (sd->name_entry) items = eina_list_append(items, sd->name_entry);
2423 if (sd->filter_hoversel) items = eina_list_append(items, sd->filter_hoversel);
2443 if (sd->cancel_button) items = eina_list_append(items, sd->cancel_button); 2424 if (sd->cancel_button) items = eina_list_append(items, sd->cancel_button);
2444 if (sd->ok_button) items = eina_list_append(items, sd->ok_button); 2425 if (sd->ok_button) items = eina_list_append(items, sd->ok_button);
2445 2426
diff --git a/src/lib/elm_fileselector.eo b/src/lib/elm_fileselector.eo
index 70a50a0ab..0ea6ba7b5 100644
--- a/src/lib/elm_fileselector.eo
+++ b/src/lib/elm_fileselector.eo
@@ -40,7 +40,6 @@ class Elm.Fileselector (Elm.Layout, Elm.Interface_Fileselector,
40 Elm.Widget.event; 40 Elm.Widget.event;
41 Elm.Widget.theme_apply; 41 Elm.Widget.theme_apply;
42 Elm.Widget.focus_next_manager_is; 42 Elm.Widget.focus_next_manager_is;
43 Elm.Layout.sizing_eval;
44 Elm.Layout.text.set; 43 Elm.Layout.text.set;
45 Elm.Interface_Fileselector.selected_paths.get; 44 Elm.Interface_Fileselector.selected_paths.get;
46 Elm.Interface_Fileselector.custom_filter_append; 45 Elm.Interface_Fileselector.custom_filter_append;