New item,focused/unfocused signals for the List widget
Plus: * Object.focused_item * ObjectItem.focus
This commit is contained in:
parent
bc32229756
commit
8b9e5901a3
|
@ -56,6 +56,8 @@ Smart callbacks one can listen to:
|
|||
- ``language,changed`` - the program's language changed
|
||||
- ``focused`` - When the list has received focus. (since 1.8)
|
||||
- ``unfocused`` - When the list has lost focus. (since 1.8)
|
||||
- ``item,focused`` - When the list item has received focus. (since 1.10)
|
||||
- ``item,unfocused`` - When the list item has lost focus. (since 1.10)
|
||||
|
||||
Available styles for it:
|
||||
|
||||
|
@ -1074,6 +1076,27 @@ cdef class List(Object):
|
|||
def callback_unfocused_del(self, func):
|
||||
self._callback_del("unfocused", func)
|
||||
|
||||
def callback_item_focused_add(self, func, *args, **kwargs):
|
||||
"""When the list item has received focus.
|
||||
|
||||
.. versionadded:: 1.10
|
||||
|
||||
"""
|
||||
self._callback_add_full("item,focused", _cb_object_item_conv, func, *args, **kwargs)
|
||||
|
||||
def callback_item_focused_del(self, func):
|
||||
self._callback_del_full("item,focused", _cb_object_item_conv, func)
|
||||
|
||||
def callback_item_unfocused_add(self, func, *args, **kwargs):
|
||||
"""When the list item has lost focus.
|
||||
|
||||
.. versionadded:: 1.10
|
||||
|
||||
"""
|
||||
self._callback_add_full("item,unfocused", _cb_object_item_conv, func, *args, **kwargs)
|
||||
|
||||
def callback_item_unfocused_del(self, func):
|
||||
self._callback_del_full("item,unfocused", _cb_object_item_conv, func)
|
||||
|
||||
property scroller_policy:
|
||||
"""
|
||||
|
|
|
@ -29,6 +29,8 @@ cdef extern from "Edje.h":
|
|||
cdef extern from "Elementary.h":
|
||||
ctypedef struct Elm_Theme
|
||||
|
||||
ctypedef struct Elm_Object_Item
|
||||
|
||||
ctypedef struct Elm_Selection_Data:
|
||||
Evas_Coord x, y
|
||||
Elm_Sel_Format format
|
||||
|
@ -103,6 +105,7 @@ cdef extern from "Elementary.h":
|
|||
Eina_Bool elm_object_tree_focus_allow_get(const Evas_Object *obj)
|
||||
Eina_Bool elm_object_focus_highlight_style_set(Evas_Object *obj, const char *style)
|
||||
const char * elm_object_focus_highlight_style_get(const Evas_Object *obj)
|
||||
Elm_Object_Item * elm_object_focused_item_get(const Evas_Object *obj)
|
||||
|
||||
# Object - Mirroring (elm_mirroring.h)
|
||||
Eina_Bool elm_object_mirrored_get(const Evas_Object *obj)
|
||||
|
|
|
@ -1122,6 +1122,21 @@ cdef class Object(evasObject):
|
|||
def focused_object_get(self):
|
||||
return object_from_instance(elm_object_focused_object_get(self.obj))
|
||||
|
||||
property focused_item:
|
||||
"""The focused object item in an object tree.
|
||||
|
||||
:return: Current focused item or None, if there is no focused item.
|
||||
|
||||
.. versionadded:: 1.10
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_object_focused_item_get(self.obj))
|
||||
|
||||
def focused_item_get(self):
|
||||
return _object_item_to_python(elm_object_focused_item_get(self.obj))
|
||||
|
||||
|
||||
property focus_highlight_style:
|
||||
"""The focus highlight style name to be used.
|
||||
|
||||
|
|
|
@ -44,6 +44,9 @@ cdef extern from "Elementary.h":
|
|||
const char * elm_object_item_cursor_style_get(const Elm_Object_Item *it)
|
||||
void elm_object_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only)
|
||||
Eina_Bool elm_object_item_cursor_engine_only_get(const Elm_Object_Item *it)
|
||||
void elm_object_item_focus_set(Elm_Object_Item *it, Eina_Bool focused)
|
||||
Eina_Bool elm_object_item_focus_get(const Elm_Object_Item *it)
|
||||
|
||||
|
||||
#TODO: Evas_Object * elm_object_item_access_register(Elm_Object_Item *item)
|
||||
#TODO: void elm_object_item_access_unregister(Elm_Object_Item *item)
|
||||
|
|
|
@ -609,6 +609,24 @@ cdef class ObjectItem(object):
|
|||
def cursor_engine_only_get(self):
|
||||
return elm_object_item_cursor_engine_only_get(self.item)
|
||||
|
||||
property focus:
|
||||
"""Whether the item is focused or not.
|
||||
|
||||
.. versionadded:: 1.10
|
||||
|
||||
"""
|
||||
def __set__(self, focused):
|
||||
elm_object_item_focus_set(self.item, bool(focused))
|
||||
|
||||
def __get__(self):
|
||||
return elm_object_item_focus_get(self.item)
|
||||
|
||||
def focus_set(self, focused):
|
||||
elm_object_item_focus_set(self.item, bool(focused))
|
||||
def focus_get(self):
|
||||
return elm_object_item_focus_get(self.item)
|
||||
|
||||
|
||||
# TODO: Accessibility
|
||||
# def access_unregister(self):
|
||||
# """Unregister accessible object of the object item.
|
||||
|
|
Loading…
Reference in New Issue