New 1.19 API: elm.GengridItem.custom_size

This commit is contained in:
Davide Andreoli 2017-03-15 19:41:17 +01:00
parent 9c00cbb0fe
commit da9258f474
2 changed files with 30 additions and 0 deletions

View File

@ -84,6 +84,8 @@ cdef extern from "Elementary.h":
void elm_gengrid_item_update(Elm_Object_Item *item)
void elm_gengrid_item_pos_get(const Elm_Object_Item *item, unsigned int *x, unsigned int *y)
void elm_gengrid_item_all_contents_unset(Elm_Object_Item *obj, Eina_List **l)
void elm_gengrid_item_custom_size_set(Elm_Object_Item *obj, Evas_Coord w, Evas_Coord h)
void elm_gengrid_item_custom_size_get(Elm_Object_Item *obj, Evas_Coord *w, Evas_Coord *h)
Elm_Object_Item * elm_gengrid_nth_item_get(const Evas_Object *obj, unsigned int nth)
Elm_Object_Item * elm_gengrid_at_xy_item_get(const Evas_Object *obj, Evas_Coord x, Evas_Coord y, int *xposret, int *yposret)

View File

@ -194,6 +194,34 @@ cdef class GengridItem(ObjectItem):
self._set_properties_from_keyword_args(self.kwargs)
return self
property custom_size:
""" Custom size mode for non-homogeneous gengrid.
In case of a horizontal grid, only the widths will be resized and
in case of vertical only the heights can be resized. Item size
should be set by elm_gengrid_item_size_set() beforehand.
:type: (int w, int h)
.. versionadded:: 1.19
"""
def __get__(self):
cdef Evas_Coord w, h
elm_gengrid_item_custom_size_get(self.item, &w, &h)
return (w, h)
def __set__(self, value):
w, h = value
elm_gengrid_item_custom_size_set(self.item, w, h)
def custom_size_set(self, w, h):
elm_gengrid_item_custom_size_set(self.item, w, h)
def custom_size_get(self):
cdef Evas_Coord w, h
elm_gengrid_item_custom_size_get(self.item, &w, &h)
return (w, h)
property data:
"""User data for the item."""
def __get__(self):