elm_panel: Add get function in scrollable_content_size property

Summary:
Added get function for getting the size of the scrollable panel.
Additionally, added some exception handling code in scrollable_content_size_set

Reviewers: woohyun, eunue

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4549
This commit is contained in:
JEONGHYUN YUN 2017-01-05 10:26:29 +09:00 committed by Jean-Philippe Andre
parent 459a23244f
commit 401488cea7
2 changed files with 39 additions and 20 deletions

View File

@ -1405,11 +1405,23 @@ _elm_panel_elm_widget_disable(Eo *obj, Elm_Panel_Data *sd)
return EINA_TRUE;
}
EOLIAN static double
_elm_panel_scrollable_content_size_get(Eo *obj EINA_UNUSED, Elm_Panel_Data *sd)
{
return sd->content_size_ratio;
}
EOLIAN static void
_elm_panel_scrollable_content_size_set(Eo *obj, Elm_Panel_Data *sd, double ratio)
{
Evas_Coord w, h;
if (ratio < 0) ratio = 0;
else if (ratio > 1.0) ratio = 1.0;
sd->content_size_ratio = ratio;
if (sd->scrollable)
{
Evas_Coord w, h;
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
switch (sd->orient)
@ -1431,6 +1443,7 @@ _elm_panel_scrollable_content_size_set(Eo *obj, Elm_Panel_Data *sd, double ratio
}
elm_layout_sizing_eval(obj);
}
}
EOLIAN static Eina_Bool

View File

@ -59,6 +59,12 @@ class Elm.Panel (Elm.Layout, Elm.Interface_Scrollable,
set {
[[Set the size of the scrollable panel.]]
}
get {
[[Get the size of the scrollable panel.
@since 1.19
]]
}
values {
ratio: double; [[Size ratio]]
}