New 1.18 API: elm.Popup.scrollable

This commit is contained in:
Davide Andreoli 2016-08-12 22:46:27 +02:00
parent 6ff9589e83
commit eaa09b6b16
3 changed files with 28 additions and 1 deletions

View File

@ -238,6 +238,21 @@ cdef class Popup(LayoutClass):
elm_popup_align_get(self.obj, &h, &v)
return (h, v)
property scrollable:
"""The scrollable state of popup content area
Normally content area does not contain scroller.
:type: bool
.. versionadded:: 1.18
"""
def __set__(self, bint scrollable):
elm_popup_scrollable_set(self.obj, scrollable)
def __get__(self):
return bool(elm_popup_scrollable_get(self.obj))
def callback_dismissed_add(self, func, *args, **kwargs):
"""When popup is closed as a result of a dismiss.

View File

@ -36,3 +36,5 @@ cdef extern from "Elementary.h":
void elm_popup_allow_events_set(Evas_Object *obj, Eina_Bool allow)
Eina_Bool elm_popup_allow_events_get(const Evas_Object *obj)
void elm_popup_dismiss(const Evas_Object *obj)
void elm_popup_scrollable_set(Evas_Object *obj, Eina_Bool scroll)
Eina_Bool elm_popup_scrollable_get(const Evas_Object *obj)

View File

@ -185,7 +185,15 @@ def cb_popup_center_title_1button_hide_effect(li, item, win):
popup.show()
def cb_popup_scrollable(li, item, win):
lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
popup = Popup(win, text=lorem*160, scrollable=True,
size_hint_weight=EXPAND_BOTH)
bt = Button(win, text="Close")
bt.callback_clicked_add(cb_bnt_close, popup)
popup.part_content_set("button1", bt)
popup.show()
def cb_popup_align(li, item, win):
popup = Popup(win, text="Align (0.2, 0.8)", align=(0.2, 0.8),
size_hint_weight=EXPAND_BOTH)
@ -243,6 +251,8 @@ def popup_clicked(obj):
cb_popup_center_text_1button_hide_show, win)
li.item_append("popup-center-title + text + 1 button + hide effect", None, None,
cb_popup_center_title_1button_hide_effect, win)
li.item_append("Popup Scrollable", None, None,
cb_popup_scrollable, win)
li.item_append("Popup Align (0.2, 0.8)", None, None,
cb_popup_align, win)
for name, val in orients: