aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/GuiLua/GuiLua.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-12 06:22:22 +1000
committerDavid Walter Seikel2014-05-12 06:22:22 +1000
commit4ac652d2887d635713b5571389acb81c0faa7100 (patch)
tree0c4457658814a5124bb8416bdb3910aeda43ee52 /src/GuiLua/GuiLua.c
parentChange WinFang title to marker, since the slider options are borked. (diff)
downloadSledjHamr-4ac652d2887d635713b5571389acb81c0faa7100.zip
SledjHamr-4ac652d2887d635713b5571389acb81c0faa7100.tar.gz
SledjHamr-4ac652d2887d635713b5571389acb81c0faa7100.tar.bz2
SledjHamr-4ac652d2887d635713b5571389acb81c0faa7100.tar.xz
GuiLua uses box for widgets if there's no x supplied.
Diffstat (limited to 'src/GuiLua/GuiLua.c')
-rw-r--r--src/GuiLua/GuiLua.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/GuiLua/GuiLua.c b/src/GuiLua/GuiLua.c
index af7e2fd..bfba073 100644
--- a/src/GuiLua/GuiLua.c
+++ b/src/GuiLua/GuiLua.c
@@ -175,7 +175,7 @@ static int widget(lua_State *L)
175 winFang *win = NULL; 175 winFang *win = NULL;
176 char *type = "button"; 176 char *type = "button";
177 char *title = ":"; 177 char *title = ":";
178 int x = 1, y = 1, w = WIDTH/3, h = HEIGHT/3; 178 int x = -1, y = -1, w = -1, h = -1;
179 179
180 pull_lua(L, 1, "*window $type $title %x %y %w %h", &win, &type, &title, &x, &y, &w, &h); 180 pull_lua(L, 1, "*window $type $title %x %y %w %h", &win, &type, &title, &x, &y, &w, &h);
181 181
@@ -185,7 +185,7 @@ static int widget(lua_State *L)
185 { 185 {
186 Widget *wid; 186 Widget *wid;
187 187
188 // These two lines are likely the only ones that will be different for the different sorts of widgets. 188 // This two lines is likely the only one that will be different for the different sorts of widgets.
189 wid = widgetAdd(win, ELM_OBJ_BUTTON_CLASS, win->win, title); 189 wid = widgetAdd(win, ELM_OBJ_BUTTON_CLASS, win->win, title);
190 wid->data = L; 190 wid->data = L;
191 eo_do(wid->obj, 191 eo_do(wid->obj,
@@ -193,15 +193,10 @@ static int widget(lua_State *L)
193 eo_key_data_set("Widget", wid, NULL) 193 eo_key_data_set("Widget", wid, NULL)
194 ); 194 );
195 195
196 if (win->grid) 196 if (x < 0)
197 elm_grid_pack(win->grid, wid->obj, x, y, w, h); 197 elm_layout_box_append(win->win, WF_BOX, wid->obj);
198 else 198 else
199 { 199 elm_grid_pack(win->grid, wid->obj, x, y, w, h);
200 eo_do(wid->obj,
201 evas_obj_size_set(w, h),
202 evas_obj_position_set(x, y)
203 );
204 }
205 winFangCalcMinSize(win); 200 winFangCalcMinSize(win);
206 evas_object_smart_callback_add(wid->obj, "clicked", _on_click, wid); 201 evas_object_smart_callback_add(wid->obj, "clicked", _on_click, wid);
207 202