diff options
author | David Walter Seikel | 2014-05-11 05:40:27 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-11 05:40:27 +1000 |
commit | 062cfdcc1b213d5cecd907a367dee51046e2eb7b (patch) | |
tree | d9df5b851518cad53452a611f17604e62033d218 /src | |
parent | Add internal window title bar, and dragging them around. Plus some related c... (diff) | |
download | SledjHamr-062cfdcc1b213d5cecd907a367dee51046e2eb7b.zip SledjHamr-062cfdcc1b213d5cecd907a367dee51046e2eb7b.tar.gz SledjHamr-062cfdcc1b213d5cecd907a367dee51046e2eb7b.tar.bz2 SledjHamr-062cfdcc1b213d5cecd907a367dee51046e2eb7b.tar.xz |
Add a rectangle to pad out those that don't use the winFang box, and have them make their widdgets relative to that.
Diffstat (limited to 'src')
-rw-r--r-- | src/GuiLua/GuiLua.c | 5 | ||||
-rw-r--r-- | src/extantz/files.c | 1 | ||||
-rw-r--r-- | src/extantz/woMan.c | 1 | ||||
-rw-r--r-- | src/libraries/winFang.c | 18 | ||||
-rw-r--r-- | src/libraries/winFang.h | 2 | ||||
-rw-r--r-- | src/purkle/purkle.c | 1 |
6 files changed, 27 insertions, 1 deletions
diff --git a/src/GuiLua/GuiLua.c b/src/GuiLua/GuiLua.c index 09c3fe9..2e16927 100644 --- a/src/GuiLua/GuiLua.c +++ b/src/GuiLua/GuiLua.c | |||
@@ -175,10 +175,13 @@ 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 = WIDTH/3, h = HEIGHT/3, cy; |
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 | ||
182 | evas_object_geometry_get(win->content, NULL, &cy, NULL, NULL); | ||
183 | y += cy; | ||
184 | |||
182 | // Poor mans introspection, until I write real introspection into EFL. | 185 | // Poor mans introspection, until I write real introspection into EFL. |
183 | // TODO - The alternative is to just lookup the ELM_*_CLASS in a hash table? | 186 | // TODO - The alternative is to just lookup the ELM_*_CLASS in a hash table? |
184 | if (strcmp(type, "button") == 0) | 187 | if (strcmp(type, "button") == 0) |
diff --git a/src/extantz/files.c b/src/extantz/files.c index 3aeb7f9..6ac151d 100644 --- a/src/extantz/files.c +++ b/src/extantz/files.c | |||
@@ -147,6 +147,7 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa | |||
147 | Evas_Object *vbox, *fs, *bt, *rd = NULL, *rdg = NULL, *hoversel; | 147 | Evas_Object *vbox, *fs, *bt, *rd = NULL, *rdg = NULL, *hoversel; |
148 | 148 | ||
149 | me = winFangAdd(ourGlobals->mainWindow, ourGlobals->win_w - 380, ourGlobals->win_w - 530, 350, 500, "file selector", "files", ourGlobals->world); | 149 | me = winFangAdd(ourGlobals->mainWindow, ourGlobals->win_w - 380, ourGlobals->win_w - 530, 350, 500, "file selector", "files", ourGlobals->world); |
150 | useBox(me); | ||
150 | 151 | ||
151 | wid = widgetAdd(me, ELM_OBJ_FILESELECTOR_CLASS, me->box, NULL); | 152 | wid = widgetAdd(me, ELM_OBJ_FILESELECTOR_CLASS, me->box, NULL); |
152 | fs = wid->obj; | 153 | fs = wid->obj; |
diff --git a/src/extantz/woMan.c b/src/extantz/woMan.c index 52b3a30..6167cb1 100644 --- a/src/extantz/woMan.c +++ b/src/extantz/woMan.c | |||
@@ -160,6 +160,7 @@ winFang *woMan_add(globals *ourGlobals) | |||
160 | int i; | 160 | int i; |
161 | 161 | ||
162 | me = winFangAdd(ourGlobals->mainWindow, 30, 200, ourGlobals->win_w / 3, ourGlobals->win_h / 3, "virtual world manager", "woMan", ourGlobals->world); | 162 | me = winFangAdd(ourGlobals->mainWindow, 30, 200, ourGlobals->win_w / 3, ourGlobals->win_h / 3, "virtual world manager", "woMan", ourGlobals->world); |
163 | useBox(me); | ||
163 | 164 | ||
164 | // A tab thingy. | 165 | // A tab thingy. |
165 | tb = elm_toolbar_add(me->win); | 166 | tb = elm_toolbar_add(me->win); |
diff --git a/src/libraries/winFang.c b/src/libraries/winFang.c index bcf99ce..5f5b575 100644 --- a/src/libraries/winFang.c +++ b/src/libraries/winFang.c | |||
@@ -262,6 +262,14 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch | |||
262 | ); | 262 | ); |
263 | elm_box_pack_end(result->box, obj1); | 263 | elm_box_pack_end(result->box, obj1); |
264 | eo_unref(obj1); | 264 | eo_unref(obj1); |
265 | |||
266 | result->content = eo_add(EVAS_OBJ_RECTANGLE_CLASS, result->win, | ||
267 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), | ||
268 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | ||
269 | evas_obj_color_set(0, 0, 0, 0), | ||
270 | evas_obj_visibility_set(EINA_TRUE) | ||
271 | ); | ||
272 | elm_box_pack_end(result->box, result->content); | ||
265 | } | 273 | } |
266 | 274 | ||
267 | evas_object_resize(result->win, result->w, result->h); | 275 | evas_object_resize(result->win, result->w, result->h); |
@@ -277,6 +285,7 @@ void winFangDel(winFang *win) | |||
277 | 285 | ||
278 | if (!win) return; | 286 | if (!win) return; |
279 | 287 | ||
288 | eo_unref(win->content); | ||
280 | eo_unref(win->box); | 289 | eo_unref(win->box); |
281 | eo_unref(win->bg); | 290 | eo_unref(win->bg); |
282 | EINA_CLIST_FOR_EACH_ENTRY(wf, &win->winFangs, winFang, node) | 291 | EINA_CLIST_FOR_EACH_ENTRY(wf, &win->winFangs, winFang, node) |
@@ -294,6 +303,15 @@ void winFangDel(winFang *win) | |||
294 | evas_object_del(win->win); | 303 | evas_object_del(win->win); |
295 | } | 304 | } |
296 | 305 | ||
306 | void useBox(winFang *win) | ||
307 | { | ||
308 | eo_do(win->content, | ||
309 | evas_obj_visibility_set(EINA_FALSE), | ||
310 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0.0), | ||
311 | evas_obj_size_set(0, 0) | ||
312 | ); | ||
313 | } | ||
314 | |||
297 | Widget *widgetAdd(winFang *win, const Eo_Class *klass, Evas_Object *parent, char *title) | 315 | Widget *widgetAdd(winFang *win, const Eo_Class *klass, Evas_Object *parent, char *title) |
298 | { | 316 | { |
299 | Widget *result; | 317 | Widget *result; |
diff --git a/src/libraries/winFang.h b/src/libraries/winFang.h index f3b4e45..17cf942 100644 --- a/src/libraries/winFang.h +++ b/src/libraries/winFang.h | |||
@@ -24,6 +24,7 @@ typedef struct _winFang | |||
24 | Evas_Object *title; | 24 | Evas_Object *title; |
25 | Evas_Object *bg; | 25 | Evas_Object *bg; |
26 | Evas_Object *box; | 26 | Evas_Object *box; |
27 | Evas_Object *content; | ||
27 | EPhysics_Body *body; | 28 | EPhysics_Body *body; |
28 | Eina_Clist widgets; | 29 | Eina_Clist widgets; |
29 | Eina_Clist winFangs; | 30 | Eina_Clist winFangs; |
@@ -58,6 +59,7 @@ void winFangHide(winFang *win); | |||
58 | void winFangShow(winFang *win); | 59 | void winFangShow(winFang *win); |
59 | void winFangDel(winFang *win); | 60 | void winFangDel(winFang *win); |
60 | 61 | ||
62 | void useBox(winFang *win); | ||
61 | Widget *widgetAdd(winFang *win, const Eo_Class *klass, Evas_Object *parent, char *title); | 63 | Widget *widgetAdd(winFang *win, const Eo_Class *klass, Evas_Object *parent, char *title); |
62 | 64 | ||
63 | #endif | 65 | #endif |
diff --git a/src/purkle/purkle.c b/src/purkle/purkle.c index ef0bbf2..6538096 100644 --- a/src/purkle/purkle.c +++ b/src/purkle/purkle.c | |||
@@ -20,6 +20,7 @@ static winFang *purkleAdd(winFang *parent, int w, int h, EPhysics_World *world) | |||
20 | Evas_Object *en; | 20 | Evas_Object *en; |
21 | 21 | ||
22 | me = winFangAdd(parent, 30, 590, w, h, "chatter box", "purkle", world); | 22 | me = winFangAdd(parent, 30, 590, w, h, "chatter box", "purkle", world); |
23 | useBox(me); | ||
23 | 24 | ||
24 | en = eo_add(ELM_OBJ_ENTRY_CLASS, me->win, | 25 | en = eo_add(ELM_OBJ_ENTRY_CLASS, me->win, |
25 | elm_obj_entry_scrollable_set(EINA_TRUE), | 26 | elm_obj_entry_scrollable_set(EINA_TRUE), |