summaryrefslogtreecommitdiff
path: root/legacy/elementary
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2012-03-27 05:48:41 +0000
committerChunEon Park <hermet@hermet.pe.kr>2012-03-27 05:48:41 +0000
commit3743154b482b9e02af19c9d396e0f9a93cd9bde2 (patch)
treed2b491c34383f831f4e268844f55fb311d2f2e66 /legacy/elementary
parentef68d86554ffd2ad0ccd0e4470543794a9cafab0 (diff)
elementary/naviframe - modified content unfocusable.
The contents will be unfocusable only when they are being pushed or popped. SVN revision: 69651
Diffstat (limited to 'legacy/elementary')
-rw-r--r--legacy/elementary/src/lib/elc_naviframe.c55
1 files changed, 38 insertions, 17 deletions
diff --git a/legacy/elementary/src/lib/elc_naviframe.c b/legacy/elementary/src/lib/elc_naviframe.c
index ff2c34529b..28e788ef1b 100644
--- a/legacy/elementary/src/lib/elc_naviframe.c
+++ b/legacy/elementary/src/lib/elc_naviframe.c
@@ -43,6 +43,7 @@ struct _Elm_Naviframe_Item
43 Evas_Coord minh; 43 Evas_Coord minh;
44 Eina_Bool back_btn: 1; 44 Eina_Bool back_btn: 1;
45 Eina_Bool title_visible: 1; 45 Eina_Bool title_visible: 1;
46 Eina_Bool content_unfocusable : 1;
46}; 47};
47 48
48static const char *widtype = NULL; 49static const char *widtype = NULL;
@@ -870,6 +871,10 @@ _pushed_finished(void *data,
870 if (!wd) return; 871 if (!wd) return;
871 872
872 evas_object_hide(VIEW(it)); 873 evas_object_hide(VIEW(it));
874
875 if (it->content)
876 elm_widget_tree_unfocusable_set(it->content, it->content_unfocusable);
877
873 if (wd->freeze_events) 878 if (wd->freeze_events)
874 evas_object_freeze_events_set(VIEW(it), EINA_FALSE); 879 evas_object_freeze_events_set(VIEW(it), EINA_FALSE);
875} 880}
@@ -880,9 +885,18 @@ _popped_finished(void *data,
880 const char *emission __UNUSED__, 885 const char *emission __UNUSED__,
881 const char *source __UNUSED__) 886 const char *source __UNUSED__)
882{ 887{
888 Widget_Data *wd;
883 Elm_Naviframe_Item *it = data; 889 Elm_Naviframe_Item *it = data;
884 if (!it) return; 890 if (!it) return;
891
892 wd = elm_widget_data_get(WIDGET(it));
893 if (!wd) return;
894
895 if (wd->preserve && it->content)
896 elm_widget_tree_unfocusable_set(it->content, it->content_unfocusable);
897
885 _item_del(data); 898 _item_del(data);
899
886 elm_widget_item_free(data); 900 elm_widget_item_free(data);
887} 901}
888 902
@@ -900,10 +914,7 @@ _show_finished(void *data,
900 wd = elm_widget_data_get(WIDGET(it)); 914 wd = elm_widget_data_get(WIDGET(it));
901 if (!wd) return; 915 if (!wd) return;
902 916
903 // FIXME : If current top's content is unfocusable, it should be restored as focusable. 917 elm_widget_tree_unfocusable_set(it->content, it->content_unfocusable);
904 // Similar cases are should be checked and should call following function.
905 if (elm_widget_tree_unfocusable_get(it->content))
906 elm_widget_tree_unfocusable_set(it->content, EINA_FALSE);
907 918
908 evas_object_smart_callback_call(WIDGET(it), 919 evas_object_smart_callback_call(WIDGET(it),
909 SIG_TRANSITION_FINISHED, 920 SIG_TRANSITION_FINISHED,
@@ -1171,7 +1182,11 @@ elm_naviframe_item_push(Evas_Object *obj,
1171 elm_object_signal_emit(VIEW(prev_it), "elm,state,cur,pushed", "elm"); 1182 elm_object_signal_emit(VIEW(prev_it), "elm,state,cur,pushed", "elm");
1172 elm_object_signal_emit(VIEW(it), "elm,state,new,pushed", "elm"); 1183 elm_object_signal_emit(VIEW(it), "elm,state,new,pushed", "elm");
1173 edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it))); 1184 edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
1174 elm_widget_tree_unfocusable_set(prev_it->content, EINA_TRUE); 1185 if (prev_it->content)
1186 {
1187 prev_it->content_unfocusable = elm_widget_tree_unfocusable_get(prev_it->content);
1188 elm_widget_tree_unfocusable_set(prev_it->content, EINA_TRUE);
1189 }
1175 edje_object_message_signal_process(elm_layout_edje_get(VIEW(it))); 1190 edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
1176 } 1191 }
1177 wd->stack = eina_inlist_append(wd->stack, EINA_INLIST_GET(it)); 1192 wd->stack = eina_inlist_append(wd->stack, EINA_INLIST_GET(it));
@@ -1196,15 +1211,14 @@ elm_naviframe_item_insert_before(Evas_Object *obj,
1196 wd = elm_widget_data_get(obj); 1211 wd = elm_widget_data_get(obj);
1197 if (!wd) return NULL; 1212 if (!wd) return NULL;
1198 1213
1199 it = _item_new(WIDGET(before), title_label, prev_btn, next_btn, content, 1214 it = _item_new(obj, title_label, prev_btn, next_btn, content, item_style);
1200 item_style);
1201 if (!it) return NULL; 1215 if (!it) return NULL;
1202 1216
1203 wd->stack = 1217 wd->stack =
1204 eina_inlist_prepend_relative(wd->stack, 1218 eina_inlist_prepend_relative(wd->stack,
1205 EINA_INLIST_GET(it), 1219 EINA_INLIST_GET(it),
1206 EINA_INLIST_GET(((Elm_Naviframe_Item *) before))); 1220 EINA_INLIST_GET(((Elm_Naviframe_Item *) before)));
1207 _sizing_eval(WIDGET(before)); 1221 _sizing_eval(obj);
1208 return (Elm_Object_Item *)it; 1222 return (Elm_Object_Item *)it;
1209} 1223}
1210 1224
@@ -1225,20 +1239,19 @@ elm_naviframe_item_insert_after(Evas_Object *obj,
1225 wd = elm_widget_data_get(obj); 1239 wd = elm_widget_data_get(obj);
1226 if (!wd) return NULL; 1240 if (!wd) return NULL;
1227 1241
1228 it = _item_new(WIDGET(after), title_label, prev_btn, next_btn, content, 1242 it = _item_new(obj, title_label, prev_btn, next_btn, content, item_style);
1229 item_style);
1230 if (!it) return NULL; 1243 if (!it) return NULL;
1231 1244
1232 if (elm_naviframe_top_item_get(WIDGET(after)) == after) 1245 if (elm_naviframe_top_item_get(obj) == after)
1233 { 1246 {
1234 evas_object_hide(VIEW(after));
1235 evas_object_show(VIEW(it)); 1247 evas_object_show(VIEW(it));
1248 evas_object_hide(VIEW(after));
1236 } 1249 }
1237 wd->stack = 1250 wd->stack =
1238 eina_inlist_append_relative(wd->stack, 1251 eina_inlist_append_relative(wd->stack,
1239 EINA_INLIST_GET(it), 1252 EINA_INLIST_GET(it),
1240 EINA_INLIST_GET(((Elm_Naviframe_Item *) after))); 1253 EINA_INLIST_GET(((Elm_Naviframe_Item *) after)));
1241 _sizing_eval(WIDGET(after)); 1254 _sizing_eval(obj);
1242 return (Elm_Object_Item *)it; 1255 return (Elm_Object_Item *)it;
1243} 1256}
1244 1257
@@ -1257,8 +1270,12 @@ elm_naviframe_item_pop(Evas_Object *obj)
1257 if (!it) return NULL; 1270 if (!it) return NULL;
1258 if (wd->preserve) 1271 if (wd->preserve)
1259 content = it->content; 1272 content = it->content;
1260 else 1273
1261 elm_widget_tree_unfocusable_set(it->content, EINA_TRUE); 1274 if (it->content)
1275 {
1276 it->content_unfocusable = elm_widget_tree_unfocusable_get(it->content);
1277 elm_widget_tree_unfocusable_set(it->content, EINA_TRUE);
1278 }
1262 1279
1263 if (wd->stack->last->prev) 1280 if (wd->stack->last->prev)
1264 prev_it = EINA_INLIST_CONTAINER_GET(wd->stack->last->prev, 1281 prev_it = EINA_INLIST_CONTAINER_GET(wd->stack->last->prev,
@@ -1332,11 +1349,15 @@ elm_naviframe_item_promote(Elm_Object_Item *it)
1332 if (!wd) return; 1349 if (!wd) return;
1333 1350
1334 if (it == elm_naviframe_top_item_get(navi_it->base.widget)) return; 1351 if (it == elm_naviframe_top_item_get(navi_it->base.widget)) return;
1335 elm_widget_tree_unfocusable_set(navi_it->content, EINA_FALSE);
1336 wd->stack = eina_inlist_demote(wd->stack, EINA_INLIST_GET(navi_it)); 1352 wd->stack = eina_inlist_demote(wd->stack, EINA_INLIST_GET(navi_it));
1337 prev_it = EINA_INLIST_CONTAINER_GET(wd->stack->last->prev, 1353 prev_it = EINA_INLIST_CONTAINER_GET(wd->stack->last->prev,
1338 Elm_Naviframe_Item); 1354 Elm_Naviframe_Item);
1339 elm_widget_tree_unfocusable_set(prev_it->content, EINA_FALSE); 1355 if (prev_it->content)
1356 {
1357 prev_it->content_unfocusable = elm_widget_tree_unfocusable_get(prev_it->content);
1358 elm_widget_tree_unfocusable_set(prev_it->content, EINA_TRUE);
1359 }
1360
1340 if (wd->freeze_events) 1361 if (wd->freeze_events)
1341 { 1362 {
1342 evas_object_freeze_events_set(VIEW(it), EINA_TRUE); 1363 evas_object_freeze_events_set(VIEW(it), EINA_TRUE);