forked from enlightenment/efl
efl: Use Eina.Size2D for size hint min
This commit is contained in:
parent
d24dcb3c24
commit
3bff7363b5
|
@ -351,7 +351,7 @@ test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
|
|||
snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
|
||||
efl_add(EFL_UI_IMAGE_CLASS, win,
|
||||
efl_file_set(efl_added, buf, NULL),
|
||||
efl_gfx_size_hint_min_set(efl_added, 64, 64),
|
||||
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(64, 64)),
|
||||
efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5),
|
||||
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _file_cb, win),
|
||||
efl_pack(box, efl_added));
|
||||
|
@ -359,7 +359,7 @@ test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
|
|||
snprintf(buf, sizeof(buf), "%s/images/sky_04.jpg", elm_app_data_dir_get());
|
||||
efl_add(EFL_UI_IMAGE_CLASS, win,
|
||||
efl_file_set(efl_added, buf, NULL),
|
||||
efl_gfx_size_hint_min_set(efl_added, 64, 64),
|
||||
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(64, 64)),
|
||||
efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5),
|
||||
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _image_cb, win),
|
||||
efl_pack(box, efl_added));
|
||||
|
|
|
@ -915,7 +915,7 @@ test_box_stack(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
/* image with a forced min size */
|
||||
snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get());
|
||||
o = efl_add(EFL_UI_IMAGE_CLASS, win,
|
||||
efl_gfx_size_hint_min_set(efl_added, 64, 64),
|
||||
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(64, 64)),
|
||||
efl_file_set(efl_added, buf, NULL));
|
||||
efl_pack(bx, o);
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ test_efl_gfx_map(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
/* image with a min size */
|
||||
snprintf(buf, sizeof(buf), "%s/images/rock_02.jpg", elm_app_data_dir_get());
|
||||
img = efl_add(EFL_UI_IMAGE_CLASS, win,
|
||||
efl_gfx_size_hint_min_set(efl_added, 64, 64),
|
||||
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(64, 64)),
|
||||
efl_file_set(efl_added, buf, NULL));
|
||||
efl_ui_image_scale_type_set(img, EFL_UI_IMAGE_SCALE_TYPE_FILL);
|
||||
evas_object_event_callback_add(img, EVAS_CALLBACK_RESIZE,
|
||||
|
|
|
@ -60,7 +60,7 @@ test_evas_map(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
/* image with a min size */
|
||||
snprintf(buf, sizeof(buf), "%s/images/rock_02.jpg", elm_app_data_dir_get());
|
||||
img = efl_add(EFL_UI_IMAGE_CLASS, win,
|
||||
efl_gfx_size_hint_min_set(efl_added, 64, 64),
|
||||
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(64, 64)),
|
||||
efl_file_set(efl_added, buf, NULL));
|
||||
efl_ui_image_scale_type_set(img, EFL_UI_IMAGE_SCALE_TYPE_FILL);
|
||||
evas_object_event_callback_add(img, EVAS_CALLBACK_RESIZE,
|
||||
|
|
|
@ -30,7 +30,7 @@ _image_create(Eo *win, const char *path)
|
|||
{
|
||||
return efl_add(EFL_UI_IMAGE_CLASS, win,
|
||||
efl_file_set(efl_added, path, NULL),
|
||||
efl_gfx_size_hint_min_set(efl_added, 20, 20));
|
||||
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(20, 20)));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -240,7 +240,7 @@ _text_resize(void *data EINA_UNUSED, const Efl_Event *ev)
|
|||
Eina_Size2D sz;
|
||||
|
||||
sz = efl_gfx_size_get(ev->object);
|
||||
efl_gfx_size_hint_min_set(ev->object, sz.w, sz.h);
|
||||
efl_gfx_size_hint_min_set(ev->object, sz);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -250,7 +250,7 @@ _textblock_resize(void *data EINA_UNUSED, const Efl_Event *ev)
|
|||
|
||||
evas_object_textblock_size_native_get(ev->object, &w, &h);
|
||||
evas_object_textblock_style_insets_get(ev->object, &l, &r, &t, &b);
|
||||
efl_gfx_size_hint_min_set(ev->object, w + l + r, h + t + b);
|
||||
efl_gfx_size_hint_min_set(ev->object, EINA_SIZE2D(w + l + r, h + t + b));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -392,7 +392,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
|
|||
efl_gfx_size_hint_weight_set(efl_added, 0.0, 0.0),
|
||||
efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5),
|
||||
efl_gfx_size_hint_max_set(efl_added, size),
|
||||
efl_gfx_size_hint_min_set(efl_added, ELM_SCALE_SIZE(48), ELM_SCALE_SIZE(48)),
|
||||
efl_gfx_size_hint_min_set(efl_added, size),
|
||||
efl_file_set(efl_added, buf, NULL),
|
||||
efl_name_set(efl_added, images[k].src_name),
|
||||
elm_object_tooltip_text_set(efl_added, images[k].src_name));
|
||||
|
|
|
@ -122,7 +122,7 @@ test_panes_minsize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
|
|||
|
||||
efl_add(EFL_UI_BUTTON_CLASS, win,
|
||||
efl_text_set(efl_added, "Left - user set min size(110,110)"),
|
||||
efl_gfx_size_hint_min_set(efl_added, 110, 110),
|
||||
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(110, 110)),
|
||||
efl_content_set(efl_part(panes, "first"), efl_added)
|
||||
);
|
||||
|
||||
|
@ -132,14 +132,14 @@ test_panes_minsize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
|
|||
);
|
||||
efl_add(EFL_UI_BUTTON_CLASS, win,
|
||||
efl_text_set(efl_added, "Up - user set min size(10,0)"),
|
||||
efl_gfx_size_hint_min_set(efl_added, 10, 0),
|
||||
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(10, 0)),
|
||||
efl_content_set(efl_part(panes_h, "first"), efl_added)
|
||||
);
|
||||
efl_ui_panes_part_hint_min_allow_set(efl_part(panes_h, "first"), EINA_TRUE);
|
||||
|
||||
efl_add(EFL_UI_BUTTON_CLASS, win,
|
||||
efl_text_set(efl_added, "Down - min size 50 40"),
|
||||
efl_gfx_size_hint_min_set(efl_added, 50, 40),
|
||||
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(50, 40)),
|
||||
efl_content_set(efl_part(panes_h, "second"), efl_added)
|
||||
);
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ user_min_slider_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
|||
{
|
||||
int val = elm_slider_value_get(event->object);
|
||||
|
||||
efl_gfx_size_hint_min_set(objects[3], val, val);
|
||||
efl_gfx_size_hint_min_set(objects[3], EINA_SIZE2D(val, val));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -461,7 +461,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
|
|||
elm_slider_horizontal_set(o, 1);
|
||||
efl_gfx_size_hint_align_set(o, 0.5, -1);
|
||||
efl_gfx_size_hint_weight_set(o, 1, 0);
|
||||
efl_gfx_size_hint_min_set(o, 100, 0);
|
||||
efl_gfx_size_hint_min_set(o, EINA_SIZE2D(100, 0));
|
||||
efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignh_slider_cb, win);
|
||||
elm_slider_min_max_set(o, -0.1, 1.0);
|
||||
elm_slider_step_set(o, 0.1);
|
||||
|
|
|
@ -54,7 +54,7 @@ test_ui_clock(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
|
|||
|
||||
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_content_set(win, efl_added),
|
||||
efl_gfx_size_hint_min_set(efl_added, 360, 240));
|
||||
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(360, 240)));
|
||||
|
||||
dt1 = efl_add(EFL_UI_CLOCK_CLASS, bx,
|
||||
efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
|
||||
|
@ -88,7 +88,7 @@ test_ui_clock(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
|
|||
efl_text_set(efl_added, "Editable Clock:"),
|
||||
efl_gfx_size_hint_weight_set(efl_added, 0.0, 0.0),
|
||||
efl_gfx_size_hint_align_set(efl_added, 0, EVAS_HINT_FILL),
|
||||
efl_gfx_size_hint_min_set(efl_added, 100, 25),
|
||||
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(100, 25)),
|
||||
efl_pack(bx, efl_added));
|
||||
|
||||
dt4 = efl_add(EFL_UI_CLOCK_CLASS, bx,
|
||||
|
|
|
@ -71,7 +71,7 @@ user_min_slider_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
|||
{
|
||||
int val = elm_slider_value_get(event->object);
|
||||
for (int i = 0; i < 6; i++)
|
||||
efl_gfx_size_hint_min_set(objects[i], val, val);
|
||||
efl_gfx_size_hint_min_set(objects[i], EINA_SIZE2D(val, val));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -163,7 +163,7 @@ _custom_layout_update(Eo *pack, void *_pd EINA_UNUSED)
|
|||
eina_iterator_free(it);
|
||||
|
||||
end:
|
||||
efl_gfx_size_hint_min_set(pack, gmw * cols, gmh * rows);
|
||||
efl_gfx_size_hint_min_set(pack, EINA_SIZE2D(gmw * cols, gmh * rows));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -407,7 +407,7 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
|
|||
efl_gfx_visible_set(grid, 1);
|
||||
|
||||
objects[i++] = o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win);
|
||||
efl_gfx_size_hint_min_set(o, 10, 10);
|
||||
efl_gfx_size_hint_min_set(o, EINA_SIZE2D(10, 10));
|
||||
efl_gfx_color_set(o, 64, 96, 128, 255);
|
||||
efl_pack_grid(grid, o, 0, 0, 3, 1);
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
|
|||
elm_slider_value_set(sld, 0);
|
||||
efl_gfx_size_hint_align_set(sld, 0.5, EFL_GFX_SIZE_HINT_FILL);
|
||||
efl_gfx_size_hint_weight_set(sld, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND);
|
||||
efl_gfx_size_hint_min_set(sld, 150, 0);
|
||||
efl_gfx_size_hint_min_set(sld, EINA_SIZE2D(150, 0));
|
||||
efl_event_callback_add(sld, EFL_UI_SLIDER_EVENT_CHANGED, _angle_changed_cb, txtpath);
|
||||
elm_box_pack_end(hbox, sld);
|
||||
efl_gfx_visible_set(sld, EINA_TRUE);
|
||||
|
@ -158,7 +158,7 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
|
|||
elm_slider_value_set(sld, 99);
|
||||
efl_gfx_size_hint_align_set(sld, 0.5, EFL_GFX_SIZE_HINT_FILL);
|
||||
efl_gfx_size_hint_weight_set(sld, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND);
|
||||
efl_gfx_size_hint_min_set(sld, 150, 0);
|
||||
efl_gfx_size_hint_min_set(sld, EINA_SIZE2D(150, 0));
|
||||
efl_event_callback_add(sld, EFL_UI_SLIDER_EVENT_CHANGED, _slice_no_changed_cb, txtpath);
|
||||
elm_box_pack_end(hbox, sld);
|
||||
efl_gfx_visible_set(sld, EINA_TRUE);
|
||||
|
|
|
@ -41,7 +41,7 @@ _bt2_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_
|
|||
|
||||
lb = efl_add(EFL_UI_TEXT_CLASS, dia,
|
||||
efl_text_set(efl_added, "This is a non-resizable dialog."),
|
||||
efl_gfx_size_hint_min_set(efl_added, 300, 150),
|
||||
efl_gfx_size_hint_min_set(efl_added, size),
|
||||
efl_gfx_size_hint_max_set(efl_added, size),
|
||||
efl_gfx_size_hint_weight_set(efl_added, 0, 0));
|
||||
|
||||
|
@ -52,21 +52,21 @@ _bt2_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_
|
|||
static void
|
||||
_size_update(void *data, const Efl_Event *ev)
|
||||
{
|
||||
int w, h, wc, hc;
|
||||
Eina_Size2D sz, max;
|
||||
int wc, hc;
|
||||
Eina_Size2D sz, max, min;
|
||||
char buf[2048];
|
||||
Eo *dia = ev->object;
|
||||
Eo *lbl = data;
|
||||
|
||||
efl_gfx_size_hint_combined_min_get(dia, &wc, &hc);
|
||||
efl_gfx_size_hint_min_get(dia, &w, &h);
|
||||
min = efl_gfx_size_hint_min_get(dia);
|
||||
max = efl_gfx_size_hint_max_get(dia);
|
||||
sz = efl_gfx_size_get(dia);
|
||||
|
||||
sprintf(buf, "This is a dialog with min/max size<br>"
|
||||
"Min size: %dx%d (requested) %dx%d (effective)<br>"
|
||||
"Max size: %dx%d<br>"
|
||||
"Current size: %dx%d", w, h, wc, hc, max.w, max.h, sz.w, sz.h);
|
||||
"Current size: %dx%d", min.w, min.h, wc, hc, max.w, max.h, sz.w, sz.h);
|
||||
//efl_text_set(lbl, buf);
|
||||
elm_object_text_set(lbl, buf);
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ _bt3_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_
|
|||
efl_content_set(dia, lb);
|
||||
|
||||
// Set min & max size (app-side)
|
||||
efl_gfx_size_hint_min_set(dia, ELM_SCALE_SIZE(0), ELM_SCALE_SIZE(100));
|
||||
efl_gfx_size_hint_min_set(dia, EINA_SIZE2D(ELM_SCALE_SIZE(0), ELM_SCALE_SIZE(100)));
|
||||
efl_gfx_size_hint_max_set(dia, EINA_SIZE2D(ELM_SCALE_SIZE(800), ELM_SCALE_SIZE(600)));
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ _bt4_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *even
|
|||
efl_content_set(dia, lb);
|
||||
|
||||
// Set min & max size (app-side)
|
||||
efl_gfx_size_hint_min_set(dia, ELM_SCALE_SIZE(0), ELM_SCALE_SIZE(100));
|
||||
efl_gfx_size_hint_min_set(dia, EINA_SIZE2D(ELM_SCALE_SIZE(0), ELM_SCALE_SIZE(100)));
|
||||
efl_gfx_size_hint_max_set(dia, EINA_SIZE2D(ELM_SCALE_SIZE(800), ELM_SCALE_SIZE(600)));
|
||||
|
||||
efl_ui_win_center(dia, EINA_TRUE, EINA_TRUE);
|
||||
|
|
|
@ -107,8 +107,7 @@ interface Efl.Gfx.Size.Hint
|
|||
size).
|
||||
]]
|
||||
values {
|
||||
w: int; [[Integer to use as the maximum width hint.]]
|
||||
h: int; [[Integer to use as the maximum height hint.]]
|
||||
sz: Eina.Size2D; [[Minimum size (hint) in pixels.]]
|
||||
}
|
||||
}
|
||||
@property hint_restricted_min {
|
||||
|
|
|
@ -193,28 +193,28 @@ _efl_ui_panes_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Panes_Data *sd)
|
|||
if (first_content)
|
||||
{
|
||||
if (!sd->first_hint_min_allow)
|
||||
efl_gfx_size_hint_combined_min_get(first_content, &sd->first_minw, &sd->first_minh);
|
||||
efl_gfx_size_hint_combined_min_get(first_content, &sd->first_min.w, &sd->first_min.h);
|
||||
else
|
||||
efl_gfx_size_hint_min_get(first_content, &sd->first_minw, &sd->first_minh);
|
||||
sd->first_min = efl_gfx_size_hint_min_get(first_content);
|
||||
}
|
||||
|
||||
if (second_content)
|
||||
{
|
||||
if (!sd->second_hint_min_allow)
|
||||
efl_gfx_size_hint_combined_min_get(second_content, &sd->second_minw, &sd->second_minh);
|
||||
efl_gfx_size_hint_combined_min_get(second_content, &sd->second_min.w, &sd->second_min.h);
|
||||
else
|
||||
efl_gfx_size_hint_min_get(second_content, &sd->second_minw, &sd->second_minh);
|
||||
sd->second_min = efl_gfx_size_hint_min_get(second_content);
|
||||
}
|
||||
|
||||
if (sd->dir == EFL_UI_DIR_HORIZONTAL)
|
||||
{
|
||||
minw = MAX(sd->first_minw, sd->second_minw);
|
||||
minh = sd->first_minh + sd->second_minh;
|
||||
minw = MAX(sd->first_min.w, sd->second_min.w);
|
||||
minh = sd->first_min.h + sd->second_min.h;
|
||||
}
|
||||
else
|
||||
{
|
||||
minw = sd->first_minw + sd->second_minw;
|
||||
minh = MAX(sd->first_minh, sd->second_minh);
|
||||
minw = sd->first_min.w + sd->second_min.w;
|
||||
minh = MAX(sd->first_min.h, sd->second_min.h);
|
||||
}
|
||||
|
||||
efl_gfx_size_hint_restricted_min_set(obj, minw, minh);
|
||||
|
@ -228,8 +228,8 @@ _set_min_size_new(void *data)
|
|||
EFL_UI_PANES_DATA_GET(obj, sd);
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
||||
|
||||
int first_minw = sd->first_minw, first_minh = sd->first_minh;
|
||||
int second_minw = sd->second_minw, second_minh = sd->second_minh;
|
||||
Eina_Size2D first_min = sd->first_min;
|
||||
Eina_Size2D second_min = sd->second_min;
|
||||
int w, h;
|
||||
double first_min_relative_size = 0.0, second_min_relative_size = 0.0;
|
||||
|
||||
|
@ -237,17 +237,17 @@ _set_min_size_new(void *data)
|
|||
|
||||
if (sd->dir == EFL_UI_DIR_HORIZONTAL)
|
||||
{
|
||||
if (first_minh + second_minh > h)
|
||||
if (first_min.h + second_min.h > h)
|
||||
{
|
||||
first_min_relative_size = first_minh/(first_minh + second_minh);
|
||||
second_min_relative_size = second_minh/(first_minh + second_minh);
|
||||
first_min_relative_size = first_min.h/(first_min.h + second_min.h);
|
||||
second_min_relative_size = second_min.h/(first_min.h + second_min.h);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (h > 0)
|
||||
{
|
||||
first_min_relative_size = first_minh/(double)h;
|
||||
second_min_relative_size = second_minh/(double)h;
|
||||
first_min_relative_size = first_min.h/(double)h;
|
||||
second_min_relative_size = second_min.h/(double)h;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -261,17 +261,17 @@ _set_min_size_new(void *data)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (first_minw + second_minw > w)
|
||||
if (first_min.w + second_min.w > w)
|
||||
{
|
||||
first_min_relative_size = first_minw/(first_minw + second_minw);
|
||||
second_min_relative_size = second_minw/(first_minw + second_minw);
|
||||
first_min_relative_size = first_min.w/(first_min.w + second_min.w);
|
||||
second_min_relative_size = second_min.w/(first_min.w + second_min.w);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (w > 0)
|
||||
{
|
||||
first_min_relative_size = first_minw/(double)w;
|
||||
second_min_relative_size = second_minw/(double)w;
|
||||
first_min_relative_size = first_min.w/(double)w;
|
||||
second_min_relative_size = second_min.w/(double)w;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,8 +4,9 @@ class Efl.Ui.Panes.Part (Efl.Ui.Layout.Part)
|
|||
data: Elm_Part_Data;
|
||||
methods {
|
||||
@property hint_min_allow {
|
||||
[[Allow user to set size hints to be respected and ignore combined min size.
|
||||
If this flag is set, the minimum size set by @Efl.Gfx.Size.Hint.hint_min.set is respected forcefully.
|
||||
[[Allow user to set size hints to be respected and ignore combined
|
||||
min size. If this flag is set, the minimum size set by
|
||||
@Efl.Gfx.Size.Hint.hint_min.set is respected forcefully.
|
||||
]]
|
||||
values {
|
||||
allow: bool; [[If $true minimum size is forced]]
|
||||
|
@ -14,15 +15,14 @@ class Efl.Ui.Panes.Part (Efl.Ui.Layout.Part)
|
|||
@property split_ratio_min {
|
||||
[[Controls the relative minimum size of panes widget's part.
|
||||
|
||||
If @Efl.Gfx.Size.Hint.hint_min.set is also used along with @.split_ratio_min.set, maximum value is set as
|
||||
minimum size to part.
|
||||
If @Efl.Gfx.Size.Hint.hint_min.set is also used along with
|
||||
@.split_ratio_min.set, maximum value is set as minimum size to part.
|
||||
]]
|
||||
values {
|
||||
size: double; [[Value between 0.0 and 1.0 representing size proportion of first part's minimum size.]]
|
||||
size: double; [[Value between 0.0 and 1.0 representing size
|
||||
proportion of first part's minimum size.]]
|
||||
}
|
||||
}
|
||||
}
|
||||
implements {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,8 +37,7 @@ struct _Efl_Ui_Panes_Data
|
|||
Efl_Ui_Dir dir;
|
||||
double left_min_relative_size;
|
||||
double right_min_relative_size;
|
||||
int first_minw, first_minh;
|
||||
int second_minw, second_minh;
|
||||
Eina_Size2D first_min, second_min;
|
||||
double first_min_split_ratio, second_min_split_ratio;
|
||||
|
||||
Evas_Coord left_min_size;
|
||||
|
|
|
@ -1237,9 +1237,9 @@ EOLIAN static void
|
|||
_efl_ui_slider_efl_ui_range_span_size_set(Eo *obj, Efl_Ui_Slider_Data *sd, Evas_Coord size)
|
||||
{
|
||||
if (_is_horizontal(sd->dir))
|
||||
efl_gfx_size_hint_min_set(efl_part(obj, "elm.swallow.bar"), size, 1);
|
||||
efl_gfx_size_hint_min_set(efl_part(obj, "elm.swallow.bar"), EINA_SIZE2D(size, 1));
|
||||
else
|
||||
efl_gfx_size_hint_min_set(efl_part(obj, "elm.swallow.bar"), 1, size);
|
||||
efl_gfx_size_hint_min_set(efl_part(obj, "elm.swallow.bar"), EINA_SIZE2D(1, size));
|
||||
}
|
||||
|
||||
EOLIAN static Evas_Coord
|
||||
|
@ -1565,30 +1565,24 @@ _span_size_set(Eo *obj, Efl_Ui_Slider_Data *sd, int w, int h)
|
|||
}
|
||||
|
||||
EOLIAN void
|
||||
_efl_ui_slider_part_efl_gfx_size_hint_hint_min_set(Eo *obj, Elm_Part_Data *_pd EINA_UNUSED, int w, int h)
|
||||
_efl_ui_slider_part_efl_gfx_size_hint_hint_min_set(Eo *obj, Elm_Part_Data *_pd EINA_UNUSED, Eina_Size2D sz)
|
||||
{
|
||||
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_LAYOUT_PART_CLASS);
|
||||
Efl_Ui_Slider_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_SLIDER_CLASS);
|
||||
|
||||
_span_size_set(pd->obj, sd, w, h);
|
||||
_span_size_set(pd->obj, sd, sz.w, sz.h);
|
||||
}
|
||||
|
||||
EOLIAN void
|
||||
_efl_ui_slider_part_efl_gfx_size_hint_hint_min_get(Eo *obj, Elm_Part_Data *_pd EINA_UNUSED, int *w, int *h)
|
||||
EOLIAN Eina_Size2D
|
||||
_efl_ui_slider_part_efl_gfx_size_hint_hint_min_get(Eo *obj, Elm_Part_Data *_pd EINA_UNUSED)
|
||||
{
|
||||
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_LAYOUT_PART_CLASS);
|
||||
Efl_Ui_Slider_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_SLIDER_CLASS);
|
||||
|
||||
if (_is_horizontal(sd->dir))
|
||||
{
|
||||
if (w) *w = sd->size;
|
||||
if (h) *h = 1;
|
||||
}
|
||||
return EINA_SIZE2D(sd->size, 1);
|
||||
else
|
||||
{
|
||||
if (w) *w = 1;
|
||||
if (h) *h = sd->size;
|
||||
}
|
||||
return EINA_SIZE2D(1, sd->size);
|
||||
}
|
||||
|
||||
#include "efl_ui_slider_part.eo.c"
|
||||
|
|
|
@ -396,7 +396,7 @@ _path_data_get(Eo *obj, Efl_Ui_Textpath_Data *pd, Eina_Bool set_min)
|
|||
}
|
||||
if (set_min)
|
||||
{
|
||||
efl_gfx_size_hint_min_set(obj, rect.w, rect.h);
|
||||
efl_gfx_size_hint_min_set(obj, rect.size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1504,33 +1504,29 @@ evas_object_size_hint_request_set(Eo *eo_obj, Evas_Coord w, Evas_Coord h)
|
|||
evas_object_inform_call_changed_size_hints(eo_obj);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_canvas_object_efl_gfx_size_hint_hint_min_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *w, Evas_Coord *h)
|
||||
EOLIAN static Eina_Size2D
|
||||
_efl_canvas_object_efl_gfx_size_hint_hint_min_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
||||
{
|
||||
if ((!obj->size_hints) || obj->delete_me)
|
||||
{
|
||||
if (w) *w = 0;
|
||||
if (h) *h = 0;
|
||||
return;
|
||||
}
|
||||
if (w) *w = obj->size_hints->user_min.w;
|
||||
if (h) *h = obj->size_hints->user_min.h;
|
||||
return EINA_SIZE2D(0, 0);
|
||||
|
||||
return obj->size_hints->user_min;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_canvas_object_efl_gfx_size_hint_hint_min_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord w, Evas_Coord h)
|
||||
_efl_canvas_object_efl_gfx_size_hint_hint_min_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Size2D sz)
|
||||
{
|
||||
if (obj->delete_me)
|
||||
return;
|
||||
|
||||
evas_object_async_block(obj);
|
||||
if (EINA_UNLIKELY(!obj->size_hints))
|
||||
{
|
||||
if (!w && !h) return;
|
||||
if (!sz.w && !sz.h) return;
|
||||
_evas_object_size_hint_alloc(eo_obj, obj);
|
||||
}
|
||||
if ((obj->size_hints->user_min.w == w) && (obj->size_hints->user_min.h == h)) return;
|
||||
obj->size_hints->user_min.w = w;
|
||||
obj->size_hints->user_min.h = h;
|
||||
if ((obj->size_hints->user_min.w == sz.w) && (obj->size_hints->user_min.h == sz.h)) return;
|
||||
obj->size_hints->user_min = sz;
|
||||
|
||||
evas_object_inform_call_changed_size_hints(eo_obj);
|
||||
}
|
||||
|
|
|
@ -1019,8 +1019,8 @@ struct _Evas_Double_Pair
|
|||
|
||||
struct _Evas_Size_Hints
|
||||
{
|
||||
Evas_Size min, user_min, request;
|
||||
Eina_Size2D max;
|
||||
Evas_Size min, request;
|
||||
Eina_Size2D user_min, max;
|
||||
Evas_Aspect aspect;
|
||||
Evas_Double_Pair align, weight;
|
||||
Evas_Border padding;
|
||||
|
|
Loading…
Reference in New Issue