aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/libraries/winFang.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-12 06:39:49 +1000
committerDavid Walter Seikel2014-05-12 06:39:49 +1000
commitc169cd5547a9f90f2c9607f1fd9b0a77eac46043 (patch)
tree4ea11e6618c80479b5595745814015e6168f28d5 /src/libraries/winFang.c
parentGuiLua uses box for widgets if there's no x supplied. (diff)
downloadSledjHamr-c169cd5547a9f90f2c9607f1fd9b0a77eac46043.zip
SledjHamr-c169cd5547a9f90f2c9607f1fd9b0a77eac46043.tar.gz
SledjHamr-c169cd5547a9f90f2c9607f1fd9b0a77eac46043.tar.bz2
SledjHamr-c169cd5547a9f90f2c9607f1fd9b0a77eac46043.tar.xz
widgetAdd now does the box / grid decision, and some oter things moved into it.
Diffstat (limited to 'src/libraries/winFang.c')
-rw-r--r--src/libraries/winFang.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/libraries/winFang.c b/src/libraries/winFang.c
index c1f448d..4eb4a7b 100644
--- a/src/libraries/winFang.c
+++ b/src/libraries/winFang.c
@@ -347,7 +347,7 @@ void winFangDel(winFang *win)
347 evas_object_del(win->win); 347 evas_object_del(win->win);
348} 348}
349 349
350Widget *widgetAdd(winFang *win, const Eo_Class *klass, Evas_Object *parent, char *title) 350Widget *widgetAdd(winFang *win, const Eo_Class *klass, char *title, int x, int y, int w, int h)
351{ 351{
352 Widget *result; 352 Widget *result;
353 353
@@ -355,19 +355,24 @@ Widget *widgetAdd(winFang *win, const Eo_Class *klass, Evas_Object *parent, char
355 strcpy(result->magic, "Widget"); 355 strcpy(result->magic, "Widget");
356 eina_clist_add_head(&win->widgets, &result->node); 356 eina_clist_add_head(&win->widgets, &result->node);
357 357
358 if (parent) 358 result->obj = eo_add(klass, win->win,
359 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
360 evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL),
361 evas_obj_visibility_set(EINA_TRUE),
362 eo_key_data_set("Widget", result, NULL)
363 );
364
365 if (x < 0)
366 elm_layout_box_append(win->win, WF_BOX, result->obj);
367 else
368 elm_grid_pack(win->grid, result->obj, x, y, w, h);
369 winFangCalcMinSize(win);
370
371 if (title)
359 { 372 {
360 result->obj = eo_add(klass, parent, 373 result->label = strdup(title);
361 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), 374 elm_object_text_set(result->obj, result->label);
362 evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), 375 evas_object_name_set(result->obj, title);
363 evas_obj_visibility_set(EINA_TRUE)
364 );
365 if (title)
366 {
367 result->label = strdup(title);
368 elm_object_text_set(result->obj, result->label);
369 evas_object_name_set(result->obj, title);
370 }
371 } 376 }
372 377
373 return result; 378 return result;