summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/bin/test_naviframe.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-07-25 21:08:53 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-07-25 21:08:53 +0000
commit51e2c4e18b25285fc26d77be538b834e1e2e47f0 (patch)
tree8c9dded9fd759c95ce6a17cee411c67de0de2606 /legacy/elementary/src/bin/test_naviframe.c
parent8f730decf1430d968ef21596d70bc58ff3a35694 (diff)
downloadefl-51e2c4e18b25285fc26d77be538b834e1e2e47f0.tar.gz
naviframe improvements:
- fixed theme to look less like an arse: - overlap theme is translucent - naviframe title visibility toggle is now animated - item pop/push animation now applies to title area as well - icon without title label is now centered (see Naviframe 2 test) - title label and subtitle are now centered among the free space, should not overlap buttons anymore. - title will use a font-size range, trying to not overlap buttons anymore. - title will use ellipsis, trying to not overlap buttons anymore. - prev/next buttons do not have a fixed min/max size anymore - emit signals elm,state,title_label,show and elm,state,title_label,hide - by default the previous button label is the title of the previous page however by using a regular elm_button with an icon and long label exposes a bug with button theme. And there is a conceptual issue: if the previous button label is too big, it will look horrible. We should have a maximum size that, if reached, should have ellipsis. This should be a different elm_button style, with elm/button/base/naviframe/back_btn/default being an alias to it. SVN revision: 74403
Diffstat (limited to 'legacy/elementary/src/bin/test_naviframe.c')
-rw-r--r--legacy/elementary/src/bin/test_naviframe.c47
1 files changed, 39 insertions, 8 deletions
diff --git a/legacy/elementary/src/bin/test_naviframe.c b/legacy/elementary/src/bin/test_naviframe.c
index 661a342625..841e212481 100644
--- a/legacy/elementary/src/bin/test_naviframe.c
+++ b/legacy/elementary/src/bin/test_naviframe.c
@@ -167,15 +167,10 @@ _page4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
void
_page3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
- Evas_Object *bt, *bt2, *ic, *content, *nf = data;
+ Evas_Object *bt2, *ic, *content, *nf = data;
char buf[PATH_MAX];
Elm_Object_Item *it;
- bt = elm_button_add(nf);
- evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
- BUTTON_TEXT_SET(bt, "Prev");
- evas_object_smart_callback_add(bt, "clicked", _navi_pop, nf);
-
bt2 = elm_button_add(nf);
evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
BUTTON_TEXT_SET(bt2, "Next");
@@ -185,7 +180,7 @@ _page3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
it = elm_naviframe_item_push(nf,
"Page 3",
- bt,
+ NULL,
bt2,
content,
NULL);
@@ -214,7 +209,8 @@ _page2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
content = _content_new(nf, img2);
- it = elm_naviframe_item_push(nf, "Page 2", NULL, bt, content, NULL);
+ it = elm_naviframe_item_push(nf, "Page 2 - Long Title Here",
+ NULL, bt, content, NULL);
elm_object_item_part_text_set(it, "subtitle", "Here is sub-title part!");
}
@@ -247,4 +243,39 @@ test_naviframe(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
evas_object_resize(win, 400, 600);
evas_object_show(win);
}
+
+void
+test_naviframe2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ Evas_Object *win, *nf, *sc, *btn, *ico, *content;
+ Elm_Object_Item *it;
+
+ win = elm_win_util_standard_add("naviframe", "Naviframe");
+ elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
+ elm_win_autodel_set(win, EINA_TRUE);
+
+ nf = elm_naviframe_add(win);
+ evas_object_size_hint_weight_set(nf, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, nf);
+ evas_object_show(nf);
+
+ sc = elm_segment_control_add(nf);
+ elm_segment_control_item_add(sc, NULL, "Show All");
+ elm_segment_control_item_add(sc, NULL, "Just Filtered");
+
+ btn = elm_button_add(nf);
+ ico = elm_icon_add(btn);
+ elm_icon_standard_set(ico, "refresh");
+ elm_layout_content_set(btn, "icon", ico);
+
+
+ content = _content_new(nf, img1);
+ it = elm_naviframe_item_push(nf, NULL, NULL, btn, content, NULL);
+ evas_object_data_set(nf, "page1", it);
+
+ elm_object_item_part_content_set(it, "icon", sc);
+
+ evas_object_resize(win, 400, 600);
+ evas_object_show(win);
+}
#endif