aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/bin/test_layout.c
diff options
context:
space:
mode:
authorIván Briano <sachieru@gmail.com>2010-10-28 17:23:53 +0000
committerIván Briano <sachieru@gmail.com>2010-10-28 17:23:53 +0000
commitbabe15679bbc76c80e0978e612e5e73def9ab0be (patch)
tree9be912e00d1c362c40ea8384072fb2c57102aa37 /legacy/elementary/src/bin/test_layout.c
parentAnd as Bruno Dilly pointed out, we already have hooks for these things, so be... (diff)
downloadefl-babe15679bbc76c80e0978e612e5e73def9ab0be.tar.gz
Little titlebar pre-made layout goes in.
This comes from a contributed widget from Samsung that was basically reproducing the code of elm_layout, so instead it was turned into a simple pre-made layout (could get more love, but once again I'm no artist). In order to make its use simpler, previous commits introduced the signal hooks for elm_layout, text_set and some macros to make it easier to set icon/end and text for layouts like this one. Also uglified a bit the test for Layout in order to show it working, but I intend to get it fixed again soon. Unless discomfitor wants to practice his Edje skills with it... just saying. SVN revision: 53971
Diffstat (limited to 'legacy/elementary/src/bin/test_layout.c')
-rw-r--r--legacy/elementary/src/bin/test_layout.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/legacy/elementary/src/bin/test_layout.c b/legacy/elementary/src/bin/test_layout.c
index 05bf3d710d..251b9c177a 100644
--- a/legacy/elementary/src/bin/test_layout.c
+++ b/legacy/elementary/src/bin/test_layout.c
@@ -14,7 +14,7 @@ _clicked_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
void
test_layout(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
- Evas_Object *win, *bg, *ly, *bt;
+ Evas_Object *win, *bg, *box, *ly, *bt;
char buf[PATH_MAX];
win = elm_win_add(NULL, "layout", ELM_WIN_BASIC);
@@ -26,11 +26,34 @@ test_layout(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(bg);
+ box = elm_box_add(win);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_win_resize_object_add(win, box);
+ evas_object_show(box);
+
+ ly = elm_layout_add(win);
+ elm_layout_theme_set(ly, "layout", "application", "titlebar");
+ elm_layout_label_set(ly, "Some title");
+ elm_box_pack_end(box, ly);
+ evas_object_show(ly);
+
+ bt = elm_icon_add(win);
+ elm_icon_standard_set(bt, "chat");
+ evas_object_size_hint_min_set(bt, 20, 20);
+ elm_layout_icon_set(ly, bt);
+
+ bt = elm_icon_add(win);
+ elm_icon_standard_set(bt, "close");
+ evas_object_size_hint_min_set(bt, 20, 20);
+ elm_layout_end_set(ly, bt);
+
ly = elm_layout_add(win);
snprintf(buf, sizeof(buf), "%s/objects/test.edj", PACKAGE_DATA_DIR);
elm_layout_file_set(ly, buf, "layout");
evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add(win, ly);
+ elm_box_pack_end(box, ly);
+ //elm_win_resize_object_add(win, ly);
evas_object_show(ly);
bt = elm_button_add(win);