summaryrefslogtreecommitdiffstats
path: root/src/eulogium.c
diff options
context:
space:
mode:
authorOlliver Schinagl <o.schinagl@ultimaker.com>2015-04-29 14:40:48 (GMT)
committerOlliver Schinagl <o.schinagl@ultimaker.com>2015-04-29 14:40:48 (GMT)
commit80349e2b16d7e0eaa955e38f1d5798b42d2eb845 (patch)
tree0914d2b47056bc6b6b7fb959e7b9158ba048ec05 /src/eulogium.c
parent5abe058108d88dfa27fbc8cdd56468c2a5761457 (diff)
downloadeulogium-80349e2b16d7e0eaa955e38f1d5798b42d2eb845.zip
eulogium-80349e2b16d7e0eaa955e38f1d5798b42d2eb845.tar.gz
eulogium-80349e2b16d7e0eaa955e38f1d5798b42d2eb845.tar.bz2
Make vertical button box homogeneous and available to all
Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Diffstat (limited to '')
-rw-r--r--src/eulogium.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/src/eulogium.c b/src/eulogium.c
index 5fcd40c..b93ada0 100644
--- a/src/eulogium.c
+++ b/src/eulogium.c
@@ -820,26 +820,47 @@ Evas_Object *eulogium_multi_screen_menu(struct eulogium_data *eulogium, Evas_Obj
Evas_Object *eulogium_dual_button_add(Evas_Object *parent, const struct button_def *left, const struct button_def *right)
{
Evas_Object *box;
- Evas_Object *obj;
+ Evas_Object *obj, *butbox;
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_homogeneous_set(box, EINA_TRUE);
+ 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_box_horizontal_set(box, EINA_TRUE);
+ butbox = elm_box_add(box);
+ evas_object_size_hint_weight_set(butbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(butbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(butbox);
+ elm_box_horizontal_set(butbox, EINA_TRUE);
+ elm_box_pack_end(box, butbox);
+
+ /* Dummy seperator that is not visible to make both buttons identical in size */
+ obj = elm_separator_add(box);
+ elm_separator_horizontal_set(obj, EINA_FALSE);
+ evas_object_size_hint_weight_set(obj, 0, 0);
+ elm_box_pack_end(butbox, obj);
+
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);
+ elm_box_pack_end(butbox, obj);
+
+ butbox = elm_box_add(box);
+ evas_object_size_hint_weight_set(butbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(butbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(butbox);
+ elm_box_horizontal_set(butbox, EINA_TRUE);
+ elm_box_pack_end(box, butbox);
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_size_hint_weight_set(obj, 0, 0);
evas_object_show(obj);
- elm_box_pack_end(box, obj);
+ elm_box_pack_end(butbox, obj);
obj = elm_button_add(box);
evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -847,7 +868,7 @@ Evas_Object *eulogium_dual_button_add(Evas_Object *parent, const struct button_d
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);
+ elm_box_pack_end(butbox, obj);
return box;
}