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:
parent
459a23244f
commit
401488cea7
|
@ -1405,11 +1405,23 @@ _elm_panel_elm_widget_disable(Eo *obj, Elm_Panel_Data *sd)
|
||||||
return EINA_TRUE;
|
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
|
EOLIAN static void
|
||||||
_elm_panel_scrollable_content_size_set(Eo *obj, Elm_Panel_Data *sd, double ratio)
|
_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;
|
sd->content_size_ratio = ratio;
|
||||||
|
|
||||||
|
if (sd->scrollable)
|
||||||
|
{
|
||||||
|
Evas_Coord w, h;
|
||||||
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
|
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
|
||||||
|
|
||||||
switch (sd->orient)
|
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);
|
elm_layout_sizing_eval(obj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eina_Bool
|
EOLIAN static Eina_Bool
|
||||||
|
|
|
@ -59,6 +59,12 @@ class Elm.Panel (Elm.Layout, Elm.Interface_Scrollable,
|
||||||
set {
|
set {
|
||||||
[[Set the size of the scrollable panel.]]
|
[[Set the size of the scrollable panel.]]
|
||||||
}
|
}
|
||||||
|
get {
|
||||||
|
[[Get the size of the scrollable panel.
|
||||||
|
|
||||||
|
@since 1.19
|
||||||
|
]]
|
||||||
|
}
|
||||||
values {
|
values {
|
||||||
ratio: double; [[Size ratio]]
|
ratio: double; [[Size ratio]]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue