aboutsummaryrefslogtreecommitdiffstats
path: root/gg_map/gg_map.c
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2013-01-12 23:38:18 +0100
committerLaurent Ghigonis <laurent@p1sec.com>2013-01-12 23:38:18 +0100
commitf94eaa414c9d5ad542a0c1a69b2650ecaa464c4b (patch)
tree3f3bd9afcb710940051bf96ee85e7cca5cee344c /gg_map/gg_map.c
parentchange default graph layout to EGRAPH_LAYOUT_KAMADAKAWAI (diff)
downloadglouglou-f94eaa414c9d5ad542a0c1a69b2650ecaa464c4b.tar.xz
glouglou-f94eaa414c9d5ad542a0c1a69b2650ecaa464c4b.zip
better UI
Diffstat (limited to 'gg_map/gg_map.c')
-rw-r--r--gg_map/gg_map.c94
1 files changed, 40 insertions, 54 deletions
diff --git a/gg_map/gg_map.c b/gg_map/gg_map.c
index a602436..dda280c 100644
--- a/gg_map/gg_map.c
+++ b/gg_map/gg_map.c
@@ -330,7 +330,7 @@ EAPI_MAIN int
elm_main(int argc, char **argv)
{
Evas_Object *win, *bg, *egraph, *panes;
- Evas_Object *bx, *tb, *tb_it, *ck, *sc, *seg_it, *lb;
+ Evas_Object *bx, *bx2, *ck, *sc, *seg_it, *lb;
Evas *evas;
struct gg_client *ggcli;
int retval = -1;
@@ -352,26 +352,44 @@ elm_main(int argc, char **argv)
elm_win_resize_object_add(win, bx);
evas_object_show(bx);
- tb = elm_toolbar_add(win);
- //elm_toolbar_homogeneous_set(tb, EINA_FALSE);
- elm_toolbar_horizontal_set(tb, EINA_FALSE);
- elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_EXPAND);
- elm_toolbar_select_mode_set(tb, ELM_OBJECT_SELECT_MODE_ALWAYS);
- //elm_toolbar_transverse_expanded_set(tb, EINA_TRUE);
- elm_object_style_set(tb, "item_centered");
- evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_box_pack_end(bx, tb);
- evas_object_show(tb);
- //elm_toolbar_item_append(tb, "edit-delete", "Delete all",
- // _cb_del_edges, NULL);
- elm_toolbar_item_separator_set(elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL), EINA_FALSE);
+ panes = elm_panes_add(win);
+ evas_object_size_hint_weight_set(panes, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(panes, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_panes_content_right_size_set(panes, 0.0);
+ elm_box_pack_end(bx, panes);
+ evas_object_show(panes);
+
+ egraph = egraph_new(evas, 1);
+ egraph_layout_set(egraph, EGRAPH_LAYOUT_KAMADAKAWAI);
+ if (!egraph)
+ goto quit;
+ evas_object_size_hint_weight_set(egraph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(egraph, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(egraph);
+ elm_object_part_content_set(panes, "left", egraph);
+
+ bx2 = elm_box_add(win);
+ //elm_box_horizontal_set(bx, EINA_FALSE);
+ evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_color_set(bx2, 255, 255, 255, 100); // XXX broken
+ evas_object_show(bx2);
+
+ lb = elm_label_add(win);
+ elm_object_style_set(lb, "marker");
+ evas_object_color_set(lb, 255, 255, 255, 255);
+ elm_object_text_set(lb,
+ "Glouglou Network Mapper<br/>"
+ "<br/>"
+ "Enjoy !<br/>");
+ evas_object_show(lb);
+ elm_box_pack_end(bx2, lb);
+
lb = elm_label_add(win);
elm_object_text_set(lb, "<b>Layout</b>");
evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, EVAS_HINT_FILL);
- tb_it = elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL);
- elm_object_item_part_content_set(tb_it, "object", lb);
+ elm_box_pack_end(bx2, lb);
sc = elm_segment_control_add(win);
//evas_object_size_hint_weight_set(sc, em->weight.w, em->weight.h);
//evas_object_size_hint_align_set(sc, em->align.x, em->align.y);
@@ -383,59 +401,27 @@ elm_main(int argc, char **argv)
elm_segment_control_item_selected_set(seg_it, EINA_FALSE);
evas_object_smart_callback_add(sc, "changed", _cb_layout_changed, NULL);
evas_object_show(sc);
- tb_it = elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL);
- elm_object_item_part_content_set(tb_it, "object", sc);
- elm_toolbar_item_separator_set(elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL), EINA_FALSE);
+ elm_box_pack_end(bx2, sc);
ck = elm_check_add(win);
elm_object_text_set(ck, "Show Node");
elm_check_state_set(ck, EINA_TRUE);
evas_object_show(ck);
evas_object_smart_callback_add(ck, "changed", _cb_show_nodes, NULL);
- tb_it = elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL);
- elm_object_item_part_content_set(tb_it, "object", ck);
+ elm_box_pack_end(bx2, ck);
ck = elm_check_add(win);
elm_object_text_set(ck, "Show Label");
elm_check_state_set(ck, EINA_TRUE);
evas_object_show(ck);
evas_object_smart_callback_add(ck, "changed", _cb_show_labels, NULL);
- tb_it = elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL);
- elm_object_item_part_content_set(tb_it, "object", ck);
+ elm_box_pack_end(bx2, ck);
ck = elm_check_add(win);
elm_object_text_set(ck, "Show Edges");
elm_check_state_set(ck, EINA_TRUE);
evas_object_show(ck);
evas_object_smart_callback_add(ck, "changed", _cb_show_edges, NULL);
- tb_it = elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL);
- elm_object_item_part_content_set(tb_it, "object", ck);
- //elm_toolbar_item_separator_set(elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL), EINA_FALSE);
- elm_toolbar_item_append(tb, "exit", "Quit",
- _cb_on_done, NULL);
+ elm_box_pack_end(bx2, ck);
- panes = elm_panes_add(win);
- evas_object_size_hint_weight_set(panes, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(panes, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_panes_content_right_size_set(panes, 0.0);
- elm_box_pack_end(bx, panes);
- evas_object_show(panes);
-
- egraph = egraph_new(evas, 1);
- egraph_layout_set(egraph, EGRAPH_LAYOUT_KAMADAKAWAI);
- if (!egraph)
- goto quit;
- evas_object_size_hint_weight_set(egraph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(egraph, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(egraph);
- elm_object_part_content_set(panes, "left", egraph);
-
- lb = elm_label_add(win);
- elm_object_style_set(lb, "marker");
- evas_object_color_set(lb, 255, 255, 255, 255);
- elm_object_text_set(lb,
- "Glouglou Network Mapper<br/>"
- "<br/>"
- "Enjoy !<br/>");
- evas_object_show(lb);
- elm_object_part_content_set(panes, "right", lb);
+ elm_object_part_content_set(panes, "right", bx2);
evas_object_resize(win, 150, 150); // XXX workaround elm sizing issue
evas_object_show(win);