2016-04-11 22:13:19 -07:00
|
|
|
#include "test.h"
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
2016-04-19 01:43:28 -07:00
|
|
|
#define EFL_PACK_LAYOUT_PROTECTED
|
2019-03-07 07:39:06 -08:00
|
|
|
#include <Efl_Ui.h>
|
2016-04-11 22:13:19 -07:00
|
|
|
#include <Elementary.h>
|
2016-04-18 19:45:34 -07:00
|
|
|
#include <assert.h>
|
2016-04-11 22:13:19 -07:00
|
|
|
|
2016-04-18 19:45:34 -07:00
|
|
|
#define CNT 10
|
|
|
|
static Evas_Object *objects[CNT] = {};
|
2016-04-11 22:13:19 -07:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
NONE,
|
|
|
|
NONE_BUT_FILL,
|
|
|
|
EQUAL,
|
|
|
|
ONE,
|
|
|
|
TWO
|
|
|
|
} Weight_Mode;
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
weights_cb(void *data, const Efl_Event *event)
|
2016-04-11 22:13:19 -07:00
|
|
|
{
|
2016-05-18 08:17:36 -07:00
|
|
|
Weight_Mode mode = elm_radio_state_value_get(event->object);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
|
|
|
switch (mode)
|
|
|
|
{
|
|
|
|
case NONE:
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(data, 0.5, 0.5);
|
2016-04-18 19:45:34 -07:00
|
|
|
for (int i = 0; i < CNT; i++)
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(objects[i], 0, 0);
|
2016-04-11 22:13:19 -07:00
|
|
|
break;
|
|
|
|
case NONE_BUT_FILL:
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(data, -1, -1);
|
2016-04-18 19:45:34 -07:00
|
|
|
for (int i = 0; i < CNT; i++)
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(objects[i], 0, 0);
|
2016-04-11 22:13:19 -07:00
|
|
|
break;
|
|
|
|
case EQUAL:
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(data, 0.5, 0.5);
|
2016-04-18 19:45:34 -07:00
|
|
|
for (int i = 0; i < CNT; i++)
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(objects[i], 1, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
break;
|
|
|
|
case ONE:
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(data, 0.5, 0.5);
|
2016-04-11 22:13:19 -07:00
|
|
|
for (int i = 0; i < 6; i++)
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(objects[i], 0, 0);
|
|
|
|
efl_gfx_hint_weight_set(objects[6], 1, 1);
|
2016-04-18 19:45:34 -07:00
|
|
|
for (int i = 7; i < CNT; i++)
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(objects[i], 0, 0);
|
2016-04-11 22:13:19 -07:00
|
|
|
break;
|
|
|
|
case TWO:
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(data, 0.5, 0.5);
|
2016-04-11 22:13:19 -07:00
|
|
|
for (int i = 0; i < 5; i++)
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(objects[i], 0, 0);
|
|
|
|
efl_gfx_hint_weight_set(objects[5], 1, 1);
|
|
|
|
efl_gfx_hint_weight_set(objects[6], 1, 1);
|
2016-04-18 19:45:34 -07:00
|
|
|
for (int i = 7; i < CNT; i++)
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(objects[i], 0, 0);
|
2016-04-11 22:13:19 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
user_min_slider_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
2016-04-11 22:13:19 -07:00
|
|
|
{
|
2016-05-18 08:17:36 -07:00
|
|
|
int val = elm_slider_value_get(event->object);
|
2017-04-16 21:41:29 -07:00
|
|
|
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_size_min_set(objects[3], EINA_SIZE2D(val, val));
|
2016-04-11 22:13:19 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
padding_slider_cb(void *data, const Efl_Event *event)
|
2016-04-11 22:13:19 -07:00
|
|
|
{
|
2016-05-18 08:17:36 -07:00
|
|
|
int val = elm_slider_value_get(event->object);
|
2017-04-16 21:41:29 -07:00
|
|
|
Eo *win = data, *box;
|
|
|
|
|
|
|
|
box = efl_key_wref_get(win, "box");
|
2019-04-24 06:41:39 -07:00
|
|
|
efl_gfx_arrangement_content_padding_set(box, val, val, EINA_TRUE);
|
2016-04-11 22:13:19 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
margin_slider_cb(void *data, const Efl_Event *event)
|
2016-04-11 22:13:19 -07:00
|
|
|
{
|
2016-05-18 08:17:36 -07:00
|
|
|
int val = elm_slider_value_get(event->object);
|
2017-04-16 21:41:29 -07:00
|
|
|
Eo *win = data, *box;
|
|
|
|
|
|
|
|
box = efl_key_wref_get(win, "box");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_margin_set(box, val, val, val, val);
|
2016-04-11 22:13:19 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
alignh_slider_cb(void *data, const Efl_Event *event)
|
2016-04-15 01:06:14 -07:00
|
|
|
{
|
|
|
|
double av, val;
|
2017-04-16 21:41:29 -07:00
|
|
|
Eo *win = data, *box;
|
|
|
|
|
|
|
|
box = efl_key_wref_get(win, "box");
|
2016-05-18 08:17:36 -07:00
|
|
|
val = elm_slider_value_get(event->object);
|
2019-04-24 06:41:39 -07:00
|
|
|
efl_gfx_arrangement_content_align_get(box, NULL, &av);
|
|
|
|
efl_gfx_arrangement_content_align_set(box, val, av);
|
2016-04-15 01:06:14 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
alignv_slider_cb(void *data, const Efl_Event *event)
|
2016-04-15 01:06:14 -07:00
|
|
|
{
|
|
|
|
double ah, val;
|
2017-04-16 21:41:29 -07:00
|
|
|
Eo *win = data, *box;
|
|
|
|
|
|
|
|
box = efl_key_wref_get(win, "box");
|
2016-05-18 08:17:36 -07:00
|
|
|
val = elm_slider_value_get(event->object);
|
2019-04-24 06:41:39 -07:00
|
|
|
efl_gfx_arrangement_content_align_get(box, &ah, NULL);
|
|
|
|
efl_gfx_arrangement_content_align_set(box, ah, val);
|
2016-04-15 01:06:14 -07:00
|
|
|
}
|
|
|
|
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
static void
|
|
|
|
alignh_btn_slider_cb(void *data, const Efl_Event *event)
|
|
|
|
{
|
|
|
|
double av, val;
|
|
|
|
Eo *win = data, *btn;
|
|
|
|
|
|
|
|
btn = efl_key_wref_get(win, "button");
|
|
|
|
val = elm_slider_value_get(event->object);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_get(btn, NULL, &av);
|
|
|
|
efl_gfx_hint_align_set(btn, val, av);
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
alignv_btn_slider_cb(void *data, const Efl_Event *event)
|
|
|
|
{
|
|
|
|
double ah, val;
|
|
|
|
Eo *win = data, *btn;
|
|
|
|
|
|
|
|
btn = efl_key_wref_get(win, "button");
|
|
|
|
val = elm_slider_value_get(event->object);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_get(btn, &ah, NULL);
|
|
|
|
efl_gfx_hint_align_set(btn, ah, val);
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
flow_check_cb(void *data, const Efl_Event *event)
|
2016-04-12 02:16:20 -07:00
|
|
|
{
|
2017-04-16 21:41:29 -07:00
|
|
|
Eina_Bool chk = elm_check_selected_get(event->object);
|
|
|
|
Eina_List *list = NULL;
|
|
|
|
Eina_Iterator *it;
|
|
|
|
Eo *box, *win, *sobj, *parent;
|
|
|
|
|
|
|
|
// Unpack all children from the box, delete it and repack into the new box
|
|
|
|
|
|
|
|
win = data;
|
|
|
|
box = efl_key_wref_get(win, "box");
|
|
|
|
parent = efl_parent_get(box);
|
|
|
|
it = efl_content_iterate(box);
|
|
|
|
EINA_ITERATOR_FOREACH(it, sobj)
|
|
|
|
list = eina_list_append(list, sobj);
|
|
|
|
eina_iterator_free(it);
|
|
|
|
efl_pack_unpack_all(box);
|
|
|
|
efl_del(box);
|
|
|
|
|
2017-08-09 06:36:29 -07:00
|
|
|
box = efl_add(chk ? EFL_UI_BOX_FLOW_CLASS : EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL));
|
2017-04-16 21:41:29 -07:00
|
|
|
efl_content_set(parent, box);
|
|
|
|
efl_key_wref_set(win, "box", box);
|
|
|
|
|
|
|
|
EINA_LIST_FREE(list, sobj)
|
|
|
|
efl_pack(box, sobj);
|
2016-04-12 02:16:20 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
horiz_check_cb(void *data, const Efl_Event *event)
|
2016-04-12 02:16:20 -07:00
|
|
|
{
|
2016-05-18 08:17:36 -07:00
|
|
|
Eina_Bool chk = elm_check_selected_get(event->object);
|
2017-04-16 21:41:29 -07:00
|
|
|
Eo *box = efl_key_wref_get(data, "box");
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(box, chk ? EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL : EFL_UI_LAYOUT_ORIENTATION_VERTICAL);
|
2016-04-12 02:16:20 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
homo_check_cb(void *data, const Efl_Event *event)
|
2016-04-12 02:16:20 -07:00
|
|
|
{
|
2016-05-18 08:17:36 -07:00
|
|
|
Eina_Bool chk = elm_check_selected_get(event->object);
|
2017-04-16 21:41:29 -07:00
|
|
|
Eo *box = efl_key_wref_get(data, "box");
|
2019-03-08 05:22:08 -08:00
|
|
|
efl_ui_box_homogeneous_set(box, chk);
|
2016-04-12 02:16:20 -07:00
|
|
|
}
|
|
|
|
|
2016-04-13 20:00:04 -07:00
|
|
|
static void
|
2016-07-18 02:00:26 -07:00
|
|
|
_custom_layout_update(Eo *pack, const void *data EINA_UNUSED)
|
2016-04-13 20:00:04 -07:00
|
|
|
{
|
2016-04-19 22:55:26 -07:00
|
|
|
Eina_Iterator *it = efl_content_iterate(pack);
|
|
|
|
int count = efl_content_count(pack), i = 0;
|
2017-09-13 19:59:44 -07:00
|
|
|
Eina_Rect rp;
|
2016-04-13 20:00:04 -07:00
|
|
|
Eo *sobj;
|
|
|
|
|
|
|
|
// Note: This is a TERRIBLE layout. Just an example of the API, not showing
|
|
|
|
// how to write a proper layout function.
|
|
|
|
|
2016-07-12 20:58:43 -07:00
|
|
|
if (!count) return;
|
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
rp = efl_gfx_entity_geometry_get(pack);
|
2016-04-13 20:00:04 -07:00
|
|
|
EINA_ITERATOR_FOREACH(it, sobj)
|
|
|
|
{
|
2017-09-13 19:59:44 -07:00
|
|
|
Eina_Rect r;
|
2017-09-13 00:49:04 -07:00
|
|
|
|
|
|
|
r.x = (rp.w / count) * i;
|
|
|
|
r.y = (rp.h / count) * i;
|
2019-02-21 09:19:45 -08:00
|
|
|
r.size = efl_gfx_hint_size_combined_min_get(sobj);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_geometry_set(sobj, r);
|
2016-04-13 20:00:04 -07:00
|
|
|
i++;
|
|
|
|
}
|
|
|
|
eina_iterator_free(it);
|
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
custom_check_cb(void *data, const Efl_Event *event)
|
2016-04-13 20:00:04 -07:00
|
|
|
{
|
2016-09-01 06:34:55 -07:00
|
|
|
EFL_OPS_DEFINE(custom_layout_ops,
|
2017-04-16 21:41:29 -07:00
|
|
|
EFL_OBJECT_OP_FUNC(efl_pack_layout_update, _custom_layout_update));
|
2016-07-19 01:21:36 -07:00
|
|
|
|
2016-05-18 08:17:36 -07:00
|
|
|
Eina_Bool chk = elm_check_selected_get(event->object);
|
2017-04-16 21:41:29 -07:00
|
|
|
Eo *box, *win = data;
|
|
|
|
|
|
|
|
box = efl_key_wref_get(win, "box");
|
2016-07-18 02:00:26 -07:00
|
|
|
|
|
|
|
// Overriding just the one function we need
|
2017-04-16 21:41:29 -07:00
|
|
|
efl_object_override(box, chk ? &custom_layout_ops : NULL);
|
2016-07-18 02:00:26 -07:00
|
|
|
|
|
|
|
// Layout request is required as the pack object doesn't know the layout
|
|
|
|
// function was just overridden.
|
2017-04-16 21:41:29 -07:00
|
|
|
efl_pack_layout_request(box);
|
2016-04-13 20:00:04 -07:00
|
|
|
}
|
|
|
|
|
2016-04-11 22:13:19 -07:00
|
|
|
void
|
|
|
|
test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
|
|
|
{
|
2017-04-16 21:41:29 -07:00
|
|
|
Evas_Object *win, *bx, *o, *vbox, *f, *hbox, *chk;
|
2016-04-11 22:13:19 -07:00
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
win = elm_win_util_standard_add("ui-box", "Efl.Ui.Box");
|
|
|
|
elm_win_autodel_set(win, EINA_TRUE);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_size_set(win, EINA_SIZE2D(600, 400));
|
2016-04-11 22:13:19 -07:00
|
|
|
|
2017-08-09 06:36:29 -07:00
|
|
|
vbox = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-04-24 06:41:39 -07:00
|
|
|
efl_gfx_arrangement_content_padding_set(vbox, 10, 10, EINA_TRUE);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_margin_set(vbox, 5, 5, 5, 5);
|
2016-04-11 22:13:19 -07:00
|
|
|
elm_win_resize_object_add(win, vbox);
|
|
|
|
|
|
|
|
|
|
|
|
/* controls */
|
|
|
|
f = elm_frame_add(win);
|
|
|
|
elm_object_text_set(f, "Controls");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(f, -1, -1);
|
|
|
|
efl_gfx_hint_weight_set(f, 1, 0);
|
2016-04-11 22:13:19 -07:00
|
|
|
efl_pack(vbox, f);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(f, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
2017-08-09 06:36:29 -07:00
|
|
|
hbox = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL));
|
2017-10-16 04:58:46 -07:00
|
|
|
efl_content_set(f, hbox);
|
2019-04-24 06:41:39 -07:00
|
|
|
efl_gfx_arrangement_content_padding_set(hbox, 10, 0, EINA_TRUE);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
/* weights radio group */
|
2016-08-15 06:44:41 -07:00
|
|
|
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(bx, 0, 0.5);
|
|
|
|
efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE);
|
2016-04-11 22:13:19 -07:00
|
|
|
efl_pack(hbox, bx);
|
|
|
|
|
|
|
|
chk = o = elm_radio_add(win);
|
|
|
|
elm_object_text_set(o, "No weight");
|
2017-05-22 23:41:17 -07:00
|
|
|
efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, win);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0, 0.5);
|
2016-04-11 22:13:19 -07:00
|
|
|
elm_radio_state_value_set(o, NONE);
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
|
|
|
o = elm_radio_add(win);
|
|
|
|
elm_object_text_set(o, "No weight + box fill");
|
2017-05-22 23:41:17 -07:00
|
|
|
efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, win);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0, 0.5);
|
2016-04-11 22:13:19 -07:00
|
|
|
elm_radio_state_value_set(o, NONE_BUT_FILL);
|
|
|
|
elm_radio_group_add(o, chk);
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
|
|
|
o = elm_radio_add(win);
|
|
|
|
elm_object_text_set(o, "Equal weights");
|
2017-05-22 23:41:17 -07:00
|
|
|
efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, win);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0, 0.5);
|
2016-04-11 22:13:19 -07:00
|
|
|
elm_radio_state_value_set(o, EQUAL);
|
|
|
|
elm_radio_group_add(o, chk);
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
|
|
|
o = elm_radio_add(win);
|
|
|
|
elm_object_text_set(o, "One weight only");
|
2017-05-22 23:41:17 -07:00
|
|
|
efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, win);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0, 0.5);
|
2016-04-11 22:13:19 -07:00
|
|
|
elm_radio_state_value_set(o, ONE);
|
|
|
|
elm_radio_group_add(o, chk);
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
|
|
|
o = elm_radio_add(win);
|
|
|
|
elm_object_text_set(o, "Two weights");
|
2017-05-22 23:41:17 -07:00
|
|
|
efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, win);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0, 0.5);
|
2016-04-11 22:13:19 -07:00
|
|
|
elm_radio_state_value_set(o, TWO);
|
|
|
|
elm_radio_group_add(o, chk);
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
|
|
|
elm_radio_value_set(chk, NONE);
|
|
|
|
|
|
|
|
|
2016-04-12 02:16:20 -07:00
|
|
|
/* misc */
|
2016-08-15 06:44:41 -07:00
|
|
|
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(bx, 0, 0.5);
|
|
|
|
efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE);
|
|
|
|
efl_gfx_hint_weight_set(bx, 0, 1);
|
2016-04-12 02:16:20 -07:00
|
|
|
efl_pack(hbox, bx);
|
|
|
|
|
|
|
|
o = elm_label_add(win);
|
|
|
|
elm_object_text_set(o, "Misc");
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-12 02:16:20 -07:00
|
|
|
|
|
|
|
o = elm_check_add(win);
|
|
|
|
elm_check_selected_set(o, 0);
|
|
|
|
elm_object_text_set(o, "Flow");
|
2017-04-16 21:41:29 -07:00
|
|
|
efl_event_callback_add(o, EFL_UI_CHECK_EVENT_CHANGED, flow_check_cb, win);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0, 0);
|
2016-04-12 02:16:20 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-12 02:16:20 -07:00
|
|
|
|
|
|
|
o = elm_check_add(win);
|
|
|
|
elm_check_selected_set(o, 1);
|
|
|
|
elm_object_text_set(o, "Horizontal");
|
2017-04-16 21:41:29 -07:00
|
|
|
efl_event_callback_add(o, EFL_UI_CHECK_EVENT_CHANGED, horiz_check_cb, win);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0, 0);
|
2016-04-12 02:16:20 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-12 02:16:20 -07:00
|
|
|
|
|
|
|
o = elm_check_add(win);
|
|
|
|
elm_check_selected_set(o, 0);
|
|
|
|
elm_object_text_set(o, "Homogenous");
|
2017-04-16 21:41:29 -07:00
|
|
|
efl_event_callback_add(o, EFL_UI_CHECK_EVENT_CHANGED, homo_check_cb, win);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0, 0);
|
2016-04-12 02:16:20 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-12 02:16:20 -07:00
|
|
|
|
2016-04-13 20:00:04 -07:00
|
|
|
o = elm_check_add(win);
|
|
|
|
elm_check_selected_set(o, 0);
|
|
|
|
elm_object_text_set(o, "Custom layout");
|
2017-04-16 21:41:29 -07:00
|
|
|
efl_event_callback_add(o, EFL_UI_CHECK_EVENT_CHANGED, custom_check_cb, win);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0, 0);
|
|
|
|
efl_gfx_hint_weight_set(o, 0, 1);
|
2016-04-12 02:16:20 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-12 02:16:20 -07:00
|
|
|
|
|
|
|
|
2016-06-09 00:42:09 -07:00
|
|
|
/* user min size setter */
|
2016-08-15 06:44:41 -07:00
|
|
|
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(bx, 0, 0.5);
|
|
|
|
efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE);
|
|
|
|
efl_gfx_hint_weight_set(bx, 0, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
efl_pack(hbox, bx);
|
|
|
|
|
|
|
|
o = elm_label_add(win);
|
2016-06-09 00:42:09 -07:00
|
|
|
elm_object_text_set(o, "User min size");
|
2016-04-11 22:13:19 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
|
|
|
o = elm_slider_add(win);
|
|
|
|
elm_slider_indicator_format_set(o, "%.0fpx");
|
|
|
|
elm_slider_indicator_show_set(o, 1);
|
|
|
|
elm_slider_horizontal_set(o, 0);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0.5, -1);
|
|
|
|
efl_gfx_hint_weight_set(o, 1, 1);
|
2017-06-12 00:06:22 -07:00
|
|
|
efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, user_min_slider_cb, NULL);
|
2016-04-11 22:13:19 -07:00
|
|
|
elm_slider_min_max_set(o, 0, 250);
|
|
|
|
elm_slider_inverted_set(o, 1);
|
|
|
|
elm_slider_value_set(o, 0);
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
/* inner box padding */
|
2016-08-15 06:44:41 -07:00
|
|
|
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(bx, 0, 0.5);
|
|
|
|
efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE);
|
|
|
|
efl_gfx_hint_weight_set(bx, 0, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
efl_pack(hbox, bx);
|
|
|
|
|
|
|
|
o = elm_label_add(win);
|
|
|
|
elm_object_text_set(o, "Padding");
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
|
|
|
o = elm_slider_add(win);
|
|
|
|
elm_slider_indicator_format_set(o, "%.0fpx");
|
|
|
|
elm_slider_indicator_show_set(o, 1);
|
|
|
|
elm_slider_horizontal_set(o, 0);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0.5, -1);
|
|
|
|
efl_gfx_hint_weight_set(o, 1, 1);
|
2017-06-12 00:06:22 -07:00
|
|
|
efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, padding_slider_cb, win);
|
2016-04-11 22:13:19 -07:00
|
|
|
elm_slider_min_max_set(o, 0, 40);
|
|
|
|
elm_slider_inverted_set(o, 1);
|
|
|
|
elm_slider_value_set(o, 10);
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
/* outer margin */
|
2016-08-15 06:44:41 -07:00
|
|
|
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(bx, 0, 0.5);
|
|
|
|
efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE);
|
|
|
|
efl_gfx_hint_weight_set(bx, 0, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
efl_pack(hbox, bx);
|
|
|
|
|
|
|
|
o = elm_label_add(win);
|
|
|
|
elm_object_text_set(o, "Margin");
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
|
|
|
o = elm_slider_add(win);
|
|
|
|
elm_slider_indicator_format_set(o, "%.0fpx");
|
|
|
|
elm_slider_indicator_show_set(o, 1);
|
|
|
|
elm_slider_horizontal_set(o, 0);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0.5, -1);
|
|
|
|
efl_gfx_hint_weight_set(o, 1, 1);
|
2017-06-12 00:06:22 -07:00
|
|
|
efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, margin_slider_cb, win);
|
2016-04-11 22:13:19 -07:00
|
|
|
elm_slider_min_max_set(o, 0, 40);
|
|
|
|
elm_slider_inverted_set(o, 1);
|
|
|
|
elm_slider_value_set(o, 10);
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
|
|
|
|
2016-04-15 01:06:14 -07:00
|
|
|
/* Box align */
|
2016-08-15 06:44:41 -07:00
|
|
|
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(bx, 0, 0.5);
|
|
|
|
efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE);
|
|
|
|
efl_gfx_hint_weight_set(bx, 1, 1);
|
2016-04-15 01:06:14 -07:00
|
|
|
efl_pack(hbox, bx);
|
|
|
|
|
|
|
|
o = elm_label_add(win);
|
|
|
|
elm_object_text_set(o, "Box align");
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-15 01:06:14 -07:00
|
|
|
|
|
|
|
o = elm_slider_add(win);
|
|
|
|
elm_slider_indicator_format_set(o, "%.1f");
|
|
|
|
elm_slider_indicator_show_set(o, 1);
|
|
|
|
elm_slider_horizontal_set(o, 0);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0.5, -1);
|
|
|
|
efl_gfx_hint_weight_set(o, 1, 1);
|
2017-06-12 00:06:22 -07:00
|
|
|
efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignv_slider_cb, win);
|
2016-04-15 01:06:14 -07:00
|
|
|
elm_slider_min_max_set(o, -0.1, 1.0);
|
|
|
|
elm_slider_step_set(o, 0.1);
|
|
|
|
elm_slider_value_set(o, 0.5);
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-15 01:06:14 -07:00
|
|
|
|
|
|
|
o = elm_slider_add(win);
|
|
|
|
elm_slider_indicator_format_set(o, "%.1f");
|
|
|
|
elm_slider_indicator_show_set(o, 1);
|
|
|
|
elm_slider_horizontal_set(o, 1);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0.5, -1);
|
|
|
|
efl_gfx_hint_weight_set(o, 1, 0);
|
|
|
|
efl_gfx_hint_size_min_set(o, EINA_SIZE2D(100, 0));
|
2017-06-12 00:06:22 -07:00
|
|
|
efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignh_slider_cb, win);
|
2016-04-15 01:06:14 -07:00
|
|
|
elm_slider_min_max_set(o, -0.1, 1.0);
|
|
|
|
elm_slider_step_set(o, 0.1);
|
|
|
|
elm_slider_value_set(o, 0.5);
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-15 01:06:14 -07:00
|
|
|
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
/* Button align */
|
|
|
|
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(bx, 0, 0.5);
|
|
|
|
efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE);
|
|
|
|
efl_gfx_hint_weight_set(bx, 1, 1);
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
efl_pack(hbox, bx);
|
|
|
|
|
|
|
|
o = elm_label_add(win);
|
|
|
|
elm_object_text_set(o, "Button align");
|
|
|
|
efl_pack(bx, o);
|
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
|
|
|
|
|
|
|
o = elm_slider_add(win);
|
|
|
|
elm_slider_indicator_format_set(o, "%.1f");
|
|
|
|
elm_slider_indicator_show_set(o, 1);
|
|
|
|
elm_slider_horizontal_set(o, 0);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0.5, -1);
|
|
|
|
efl_gfx_hint_weight_set(o, 1, 1);
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignv_btn_slider_cb, win);
|
|
|
|
elm_slider_min_max_set(o, 0.0, 1.0);
|
|
|
|
elm_slider_step_set(o, 0.1);
|
|
|
|
elm_slider_value_set(o, 0.5);
|
|
|
|
efl_pack(bx, o);
|
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
|
|
|
|
|
|
|
o = elm_slider_add(win);
|
|
|
|
elm_slider_indicator_format_set(o, "%.1f");
|
|
|
|
elm_slider_indicator_show_set(o, 1);
|
|
|
|
elm_slider_horizontal_set(o, 1);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0.5, -1);
|
|
|
|
efl_gfx_hint_weight_set(o, 1, 0);
|
|
|
|
efl_gfx_hint_size_min_set(o, EINA_SIZE2D(100, 0));
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignh_btn_slider_cb, win);
|
|
|
|
elm_slider_min_max_set(o, -0.1, 1.0);
|
|
|
|
elm_slider_step_set(o, 0.1);
|
|
|
|
elm_slider_value_set(o, 0.5);
|
|
|
|
efl_pack(bx, o);
|
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
|
|
|
|
2016-04-15 01:06:14 -07:00
|
|
|
|
2016-04-11 22:13:19 -07:00
|
|
|
/* contents */
|
|
|
|
f = elm_frame_add(win);
|
|
|
|
elm_object_text_set(f, "Contents");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(f, -1, -1);
|
|
|
|
efl_gfx_hint_weight_set(f, 1, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
efl_pack(vbox, f);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(f, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
2017-08-09 06:36:29 -07:00
|
|
|
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL));
|
2017-04-16 21:41:29 -07:00
|
|
|
efl_key_wref_set(win, "box", bx);
|
2019-04-24 06:41:39 -07:00
|
|
|
efl_gfx_arrangement_content_padding_set(bx, 10, 10, EINA_TRUE);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(bx, 0.5, 0.5);
|
|
|
|
efl_gfx_hint_weight_set(bx, 1, 1);
|
2017-10-16 04:58:46 -07:00
|
|
|
efl_content_set(f, bx);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx);
|
|
|
|
efl_text_set(o, "Btn1");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, 0, 0);
|
|
|
|
efl_gfx_hint_align_set(o, 0.5, 0.5);
|
|
|
|
efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE);
|
2016-04-11 22:13:19 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx);
|
|
|
|
efl_text_set(o, "Button 2");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, 0, 0);
|
2016-04-11 22:13:19 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
2016-04-18 19:45:34 -07:00
|
|
|
objects[i++] = o = elm_label_add(win);
|
|
|
|
elm_label_line_wrap_set(o, ELM_WRAP_WORD);
|
|
|
|
elm_object_text_set(o, "This label is not marked as fill");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0.5, 0.5);
|
2016-04-11 22:13:19 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx);
|
|
|
|
efl_text_set(o, "Min size");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, 0, 0);
|
|
|
|
efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE);
|
|
|
|
efl_gfx_hint_align_set(o, 0.5, 1.0);
|
|
|
|
efl_gfx_hint_aspect_set(o, EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 1));
|
2016-04-11 22:13:19 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx);
|
|
|
|
efl_text_set(o, "Quit!");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, 0, 0);
|
|
|
|
efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE);
|
|
|
|
efl_gfx_hint_align_set(o, 0.5, 0.0);
|
2016-04-11 22:13:19 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
2016-04-18 19:45:34 -07:00
|
|
|
objects[i++] = o = elm_label_add(win);
|
|
|
|
elm_label_line_wrap_set(o, ELM_WRAP_WORD);
|
|
|
|
elm_object_text_set(o, "This label on the other hand<br/>is marked as align=fill.");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, -1, -1);
|
2016-04-11 22:13:19 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx);
|
|
|
|
efl_key_wref_set(win, "button", o);
|
|
|
|
efl_text_set(o, "Button with a quite long text.");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, 0, 0);
|
|
|
|
efl_gfx_hint_size_max_set(o, EINA_SIZE2D(200, 100));
|
2016-04-18 19:45:34 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-18 19:45:34 -07:00
|
|
|
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx);
|
|
|
|
efl_text_set(o, "BtnA");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, 0, 0);
|
|
|
|
efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE);
|
|
|
|
efl_gfx_hint_aspect_set(o, EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 2));
|
2016-04-11 22:13:19 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx);
|
|
|
|
efl_text_set(o, "BtnB");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, 0, 0);
|
|
|
|
efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE);
|
2016-04-18 19:45:34 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-18 19:45:34 -07:00
|
|
|
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx);
|
|
|
|
efl_text_set(o, "BtnC");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, 0, 0);
|
|
|
|
efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE);
|
2016-04-18 19:45:34 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-18 19:45:34 -07:00
|
|
|
|
|
|
|
assert(i == CNT);
|
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(win, 1);
|
2016-04-11 22:13:19 -07:00
|
|
|
}
|