aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/extantz/woMan.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2015-12-31 15:53:54 +1000
committerDavid Walter Seikel2015-12-31 15:53:54 +1000
commit556eca046775a1e612006bff8ed5ca36c6216c93 (patch)
tree0f0498918dcbcdd9dcea33be9b88e3a9c7d8e3c2 /src/extantz/woMan.c
parentReplace cube and sphere code with Evas_3D primitives. (diff)
downloadSledjHamr-556eca046775a1e612006bff8ed5ca36c6216c93.zip
SledjHamr-556eca046775a1e612006bff8ed5ca36c6216c93.tar.gz
SledjHamr-556eca046775a1e612006bff8ed5ca36c6216c93.tar.bz2
SledjHamr-556eca046775a1e612006bff8ed5ca36c6216c93.tar.xz
Fix menus, with an evil hack.
ELM managed to break the main menu, it never showed, no matter what I did, but the woMan menus worked fine. Refactored both so they use generic functions for building the menu. Put the main menu in it's own window, which mostly works fine. I gotta rip the elm menu system a new one, or just drop it entirely and build my own.
Diffstat (limited to '')
-rw-r--r--src/extantz/woMan.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/extantz/woMan.c b/src/extantz/woMan.c
index 42b31fc..5436cc2 100644
--- a/src/extantz/woMan.c
+++ b/src/extantz/woMan.c
@@ -155,26 +155,14 @@ winFang *woMan_add(globals *ourGlobals)
155{ 155{
156 winFang *me; 156 winFang *me;
157 Evas_Object *bt, *nf, *tab, *tb, *gridList, *viewerList, *menu; 157 Evas_Object *bt, *nf, *tab, *tb, *gridList, *viewerList, *menu;
158 Elm_Object_Item *tb_it, *menu_it, *tab_it; 158 Elm_Object_Item *menu_it, *tab_it;
159 char buf[PATH_MAX]; 159 char buf[PATH_MAX];
160 int i; 160 int i;
161 161
162 me = winFangAdd(ourGlobals->mainWindow, 600, 650, ourGlobals->win_w / 3, ourGlobals->win_h / 3, "virtual world manager", "woMan", ourGlobals->world); 162 me = winFangAdd(ourGlobals->mainWindow, 600, 650, ourGlobals->win_w / 3, ourGlobals->win_h / 3, "virtual world manager", "woMan", ourGlobals->world);
163 163
164 // A tab thingy. 164 tb = makeMainMenu(me);
165 tb = elm_toolbar_add(me->win); 165 menu = menuAdd(me, tb, "Menu");
166 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0.0);
167 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
168 elm_toolbar_shrink_mode_set(tb, ELM_TOOLBAR_SHRINK_SCROLL);
169
170 // Menu.
171 tb_it = elm_toolbar_item_append(tb, NULL, "Menu", NULL, NULL);
172 elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
173 // Priority is for when toolbar items are set to hide or menu when there are too many of them. They get hidden or put on the menu based on priority.
174 elm_toolbar_item_priority_set(tb_it, 9999);
175 elm_toolbar_menu_parent_set(tb, me->win);
176 menu = elm_toolbar_item_menu_get(tb_it);
177
178 menu_it = elm_menu_item_add(menu, NULL, NULL, "edit", NULL, NULL); 166 menu_it = elm_menu_item_add(menu, NULL, NULL, "edit", NULL, NULL);
179 elm_menu_item_add(menu, menu_it, NULL, "preferences", NULL, NULL); 167 elm_menu_item_add(menu, menu_it, NULL, "preferences", NULL, NULL);
180 menu_it = elm_menu_item_add(menu, NULL, NULL, "help", NULL, NULL); 168 menu_it = elm_menu_item_add(menu, NULL, NULL, "help", NULL, NULL);
@@ -183,9 +171,7 @@ winFang *woMan_add(globals *ourGlobals)
183 menu_it = elm_menu_item_add(menu, NULL, NULL, "advanced", NULL, NULL); 171 menu_it = elm_menu_item_add(menu, NULL, NULL, "advanced", NULL, NULL);
184 elm_menu_item_add(menu, menu_it, NULL, "debug settings", NULL, NULL); 172 elm_menu_item_add(menu, menu_it, NULL, "debug settings", NULL, NULL);
185 173
186 // The toolbar needs to be packed into the box AFTER the menus are added. 174 makeMainMenuFinish(me, tb);
187 elm_layout_box_append(me->win, WF_BOX, tb);
188 evas_object_show(tb);
189 175
190 gridList = elm_genlist_add(me->win); 176 gridList = elm_genlist_add(me->win);
191 grids = eina_hash_stringshared_new(free); 177 grids = eina_hash_stringshared_new(free);
@@ -280,7 +266,6 @@ winFang *woMan_add(globals *ourGlobals)
280 elm_object_text_set(bt, "Login"); // No eo interface for this that I can find. 266 elm_object_text_set(bt, "Login"); // No eo interface for this that I can find.
281// evas_object_smart_callback_add(bt, "clicked", NULL, NULL); 267// evas_object_smart_callback_add(bt, "clicked", NULL, NULL);
282 elm_layout_box_append(me->win, WF_BOX, bt); 268 elm_layout_box_append(me->win, WF_BOX, bt);
283// eo_unref(bt);
284 269
285 winFangCalcMinSize(me); 270 winFangCalcMinSize(me);
286 271