summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-11-14 12:05:18 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-11-14 12:05:18 +0100
commit32721ed9ce780eef73e6c14fdc27a6821ef6baf9 (patch)
tree3aa052b89931385649b10e051df8cdee47546b1c
parentbc74101ec0bb15b7a5681304ac799e23ab123667 (diff)
app: use elm_layout instead of hand made edje loading code
-rw-r--r--app/src/bin/gui.c34
1 files changed, 3 insertions, 31 deletions
diff --git a/app/src/bin/gui.c b/app/src/bin/gui.c
index 395600c..b47d45c 100644
--- a/app/src/bin/gui.c
+++ b/app/src/bin/gui.c
@@ -41,24 +41,6 @@ _on_tunnel_signal(void *data, Evas_Object *obj, const char *sig, const char *src
41 _app_exit(app); 41 _app_exit(app);
42} 42}
43 43
44/* EDJE */
45
46static Eina_Bool
47_load_edje_group(Evas_Object *evas, const char *group, const char *edje_path)
48{
49 if (!edje_object_file_set(evas, edje_path, group))
50 {
51 int err = edje_object_load_error_get(evas);
52 const char *errmsg = edje_load_error_str(err);
53 ERR("Could not load '%s' group from %s: %s",
54 group, edje_path, errmsg);
55
56 return EINA_FALSE;
57 }
58
59 return EINA_TRUE;
60}
61
62/* NAVIFRAME */ 44/* NAVIFRAME */
63 45
64static void 46static void
@@ -116,22 +98,12 @@ _frame_tunnel_create(void *data, Evas_Object *obj EINA_UNUSED, void *event_info
116 Evas_Object *layout; 98 Evas_Object *layout;
117 99
118 // load and add the elm layout 100 // load and add the elm layout
119 /* layout = elm_layout_add(app->nf); */ 101 layout = elm_layout_add(app->gui.nf);
120 /* evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); */ 102 elm_layout_file_set(layout, app->theme_path, "tunnel_layout");
121 /* elm_layout_file_set(layout, app->theme_path, "tunnel_layout"); */
122
123 // load and add the edje layout
124 layout = edje_object_add(app->gui.nf);
125 if (!_load_edje_group(layout, "tunnel_layout", app->theme_path))
126 {
127 evas_object_del(layout);
128 return;
129 }
130 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 103 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
131 elm_win_resize_object_add(app->gui.nf, layout);
132 evas_object_show(layout); 104 evas_object_show(layout);
133 105
134 edje_object_signal_callback_add(layout, "*", "*", _on_tunnel_signal, app); 106 elm_object_signal_callback_add(layout, "*", "*", _on_tunnel_signal, app);
135 107
136 it = elm_naviframe_item_push(app->gui.nf, "Tunnel", NULL, NULL, layout, NULL); 108 it = elm_naviframe_item_push(app->gui.nf, "Tunnel", NULL, NULL, layout, NULL);
137 evas_object_data_set(app->gui.nf, "page2", it); 109 evas_object_data_set(app->gui.nf, "page2", it);