aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/libraries
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/libraries/winFang.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/libraries/winFang.c b/src/libraries/winFang.c
index b99cfdb..0f2c5a5 100644
--- a/src/libraries/winFang.c
+++ b/src/libraries/winFang.c
@@ -192,6 +192,7 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch
192 result->w = w; 192 result->w = w;
193 result->h = h; 193 result->h = h;
194 194
195 // NOTE: parent = NULL is a special case, it's our main window. Not sure yet what to do if there's more than one.
195 if (result->parent) 196 if (result->parent)
196 { 197 {
197 eina_clist_add_head(&parent->winFangs, &result->node); 198 eina_clist_add_head(&parent->winFangs, &result->node);
@@ -202,9 +203,11 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch
202 else 203 else
203 { 204 {
204 result->win = elm_win_add(NULL, name, ELM_WIN_BASIC); 205 result->win = elm_win_add(NULL, name, ELM_WIN_BASIC);
205 evas_object_move(result->win, result->x, result->y);
206 evas_object_smart_callback_add(result->win, "delete,request", _on_done, NULL); 206 evas_object_smart_callback_add(result->win, "delete,request", _on_done, NULL);
207 evas_object_resize(result->win, result->w, result->h);
208 evas_object_move(result->win, result->x, result->y);
207 elm_win_title_set(result->win, title); 209 elm_win_title_set(result->win, title);
210 evas_object_show(result->win);
208 211
209 obj = result->win; 212 obj = result->win;
210 x = 0; y = 0; 213 x = 0; y = 0;
@@ -302,8 +305,11 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch
302 305
303 } 306 }
304 307
305 evas_object_resize(result->win, result->w, result->h); 308 if (result->parent)
306 evas_object_show(result->win); 309 {
310 evas_object_resize(result->win, result->w, result->h);
311 evas_object_show(result->win);
312 }
307 winFangCalcMinSize(result); 313 winFangCalcMinSize(result);
308 314
309 return result; 315 return result;
@@ -430,7 +436,7 @@ Widget *widgetAdd(winFang *win, char *type , char *title, int x, int y, int w, i
430 } 436 }
431 437
432 if (x < 0) 438 if (x < 0)
433 elm_layout_box_append(win->win, WF_BOX, result->obj); 439 elm_layout_box_append(win->layout, WF_BOX, result->obj);
434 else 440 else
435 elm_grid_pack(win->grid, result->obj, x, y, w, h); 441 elm_grid_pack(win->grid, result->obj, x, y, w, h);
436 442
@@ -527,10 +533,10 @@ Evas_Object *makeMainMenu(winFang *win)
527 ); 533 );
528} 534}
529 535
530static void _on_menu_focus(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) 536//static void _on_menu_focus(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
531{ 537//{
532 evas_object_raise(obj); 538// evas_object_raise(obj);
533} 539//}
534 540
535Evas_Object *menuAdd(winFang *win, Evas_Object *tb, char *label) 541Evas_Object *menuAdd(winFang *win, Evas_Object *tb, char *label)
536{ 542{
@@ -545,7 +551,7 @@ Evas_Object *menuAdd(winFang *win, Evas_Object *tb, char *label)
545 // This alledgedly marks it as a menu (not true), and gets an Evas_Object for us to play with. 551 // This alledgedly marks it as a menu (not true), and gets an Evas_Object for us to play with.
546 menu = elm_toolbar_item_menu_get(tb_it); 552 menu = elm_toolbar_item_menu_get(tb_it);
547 // Alas this does not work. B-( 553 // Alas this does not work. B-(
548 evas_object_smart_callback_add(menu, "focused", _on_menu_focus, NULL); 554// evas_object_smart_callback_add(menu, "focused", _on_menu_focus, NULL);
549 555
550 // 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. 556 // 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.
551 elm_toolbar_item_priority_set(tb_it, 9999); 557 elm_toolbar_item_priority_set(tb_it, 9999);
@@ -553,6 +559,8 @@ Evas_Object *menuAdd(winFang *win, Evas_Object *tb, char *label)
553 // The docs for this functien are meaningless, but it wont work right if you leave it out. 559 // The docs for this functien are meaningless, but it wont work right if you leave it out.
554 elm_toolbar_menu_parent_set(tb, win->win); 560 elm_toolbar_menu_parent_set(tb, win->win);
555 561
562 elm_toolbar_homogeneous_set(tb, EINA_FALSE);
563
556 // Add a seperator after, so that there's some visual distinction between menu items. 564 // Add a seperator after, so that there's some visual distinction between menu items.
557 // Coz using all lower case and with no underline on the first letter, it's hard to tell. 565 // Coz using all lower case and with no underline on the first letter, it's hard to tell.
558 tb_it = elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL); 566 tb_it = elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL);