diff options
author | Olliver Schinagl <o.schinagl@ultimaker.com> | 2015-04-29 14:14:52 (GMT) |
---|---|---|
committer | Olliver Schinagl <o.schinagl@ultimaker.com> | 2015-04-29 14:14:52 (GMT) |
commit | 5abe058108d88dfa27fbc8cdd56468c2a5761457 (patch) | |
tree | 08d9a364577444091f015899fdfaba97bf6e6683 | |
parent | 83a1c274b930f20b5179cdbc7fa41525f2ee9ed3 (diff) | |
download | eulogium-5abe058108d88dfa27fbc8cdd56468c2a5761457.zip eulogium-5abe058108d88dfa27fbc8cdd56468c2a5761457.tar.gz eulogium-5abe058108d88dfa27fbc8cdd56468c2a5761457.tar.bz2 |
split tripple menu up into a dual button
Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
-rw-r--r-- | src/eulogium.c | 66 |
1 files changed, 37 insertions, 29 deletions
diff --git a/src/eulogium.c b/src/eulogium.c index d7f0e3b..5fcd40c 100644 --- a/src/eulogium.c +++ b/src/eulogium.c @@ -814,42 +814,50 @@ Evas_Object *eulogium_multi_screen_menu(struct eulogium_data *eulogium, Evas_Obj elm_box_pack_end(_bottom, object); } - return eulogium_split_screen(parent, _top, _bottom);; + return eulogium_split_screen(parent, _top, _bottom); } -Evas_Object *eulogium_tripple_button_menu(Evas_Object *parent, const struct button_def *left, const struct button_def *right, const struct button_def *bottom) +Evas_Object *eulogium_dual_button_add(Evas_Object *parent, const struct button_def *left, const struct button_def *right) { - Evas_Object *object; - Evas_Object *_top, *_bottom; + Evas_Object *box; + Evas_Object *obj; - _top = elm_box_add(parent); - elm_box_horizontal_set(_top, EINA_TRUE); - evas_object_show(_top); + box = elm_box_add(parent); + evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0); + evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0); + elm_box_horizontal_set(box, EINA_TRUE); + + obj = elm_button_add(box); + evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_text_set(obj, left->text); + evas_object_smart_callback_add(obj, "clicked", left->cb.func, left->cb.data); + evas_object_show(obj); + elm_box_pack_end(box, obj); - object = elm_button_add(_top); - evas_object_size_hint_align_set(object, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(object, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_text_set(object, left->text); - evas_object_smart_callback_add(object, "clicked", left->cb.func, left->cb.data); - evas_object_data_set(object, "type", "b"); - evas_object_show(object); - elm_box_pack_end(_top, object); + obj = elm_separator_add(box); + elm_separator_horizontal_set(obj, EINA_FALSE); + evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, 0); + evas_object_show(obj); + elm_box_pack_end(box, obj); - object = elm_separator_add(_top); - elm_separator_horizontal_set(object, EINA_FALSE); - evas_object_size_hint_weight_set(object, 0, EVAS_HINT_EXPAND); - evas_object_data_set(object, "type", "s"); - evas_object_show(object); - elm_box_pack_end(_top, object); + obj = elm_button_add(box); + evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_text_set(obj, right->text); + evas_object_smart_callback_add(obj, "clicked", right->cb.func, right->cb.data); + evas_object_show(obj); + elm_box_pack_end(box, obj); - object = elm_button_add(_top); - evas_object_size_hint_align_set(object, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(object, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_text_set(object, right->text); - evas_object_data_set(object, "type", "b"); - evas_object_smart_callback_add(object, "clicked", right->cb.func, right->cb.data); - evas_object_show(object); - elm_box_pack_end(_top, object); + return box; +} + +Evas_Object *eulogium_tripple_button_menu(Evas_Object *parent, const struct button_def *left, const struct button_def *right, const struct button_def *bottom) +{ + Evas_Object *_top, *_bottom; + + _top = eulogium_dual_button_add(parent, left, right); + evas_object_show(_top); _bottom = elm_button_add(parent); elm_object_text_set(_bottom, bottom->text); |