Elementary: Fix object item tooltips
It would be an ABI breakage if the tooltips had ever worked in the first place but apparently they never did.
This commit is contained in:
parent
9434ccf64a
commit
43c3d0521a
|
@ -319,11 +319,11 @@ cdef class GengridItem(ObjectItem):
|
|||
def tooltip_content_cb_set(self, func, *args, **kargs):
|
||||
"""Set the content to be shown in the tooltip object
|
||||
|
||||
Setup the tooltip to object. The object can have only one tooltip,
|
||||
so any previews tooltip data is removed. ``func(args, kargs)`` will
|
||||
be called every time that need show the tooltip and it should return a
|
||||
valid Evas_Object. This object is then managed fully by tooltip system
|
||||
and is deleted when the tooltip is gone.
|
||||
Setup the tooltip to object. The object can have only one tooltip, so
|
||||
any previews tooltip data is removed. ``func(owner, item, tooltip,
|
||||
args, kargs)`` will be called every time that need show the tooltip and
|
||||
it should return a valid Evas_Object. This object is then managed fully
|
||||
by tooltip system and is deleted when the tooltip is gone.
|
||||
|
||||
:param func: Function to be create tooltip content, called when
|
||||
need show tooltip.
|
||||
|
@ -334,9 +334,9 @@ cdef class GengridItem(ObjectItem):
|
|||
|
||||
cdef void *cbdata
|
||||
|
||||
data = (func, self, args, kargs)
|
||||
data = (func, args, kargs)
|
||||
Py_INCREF(data)
|
||||
# FIXME: refleak?
|
||||
# DECREF is in data_del_cb
|
||||
cbdata = <void *>data
|
||||
elm_gengrid_item_tooltip_content_cb_set(self.item,
|
||||
_tooltip_item_content_create,
|
||||
|
|
|
@ -399,11 +399,11 @@ cdef class GenlistItem(ObjectItem):
|
|||
def tooltip_content_cb_set(self, func, *args, **kargs):
|
||||
"""Set the content to be shown in the tooltip object
|
||||
|
||||
Setup the tooltip to object. The object can have only one tooltip,
|
||||
so any previews tooltip data is removed. ``func(args,kargs)`` will
|
||||
be called every time that need show the tooltip and it should return
|
||||
a valid Evas_Object. This object is then managed fully by tooltip
|
||||
system and is deleted when the tooltip is gone.
|
||||
Setup the tooltip to object. The object can have only one tooltip, so
|
||||
any previews tooltip data is removed. ``func(owner, item, tooltip,
|
||||
args, kargs)`` will be called every time that need show the tooltip and
|
||||
it should return a valid Evas_Object. This object is then managed fully
|
||||
by tooltip system and is deleted when the tooltip is gone.
|
||||
|
||||
:param func: Function to be create tooltip content, called when
|
||||
need show tooltip.
|
||||
|
@ -414,8 +414,9 @@ cdef class GenlistItem(ObjectItem):
|
|||
|
||||
cdef void *cbdata
|
||||
|
||||
data = (func, self, args, kargs)
|
||||
data = (func, args, kargs)
|
||||
Py_INCREF(data)
|
||||
# DECREF is in data_del_cb
|
||||
cbdata = <void *>data
|
||||
elm_genlist_item_tooltip_content_cb_set(self.item,
|
||||
_tooltip_item_content_create,
|
||||
|
|
|
@ -477,12 +477,11 @@ cdef class ObjectItem(object):
|
|||
def tooltip_content_cb_set(self, func, *args, **kargs):
|
||||
"""Set the content to be shown in the tooltip object
|
||||
|
||||
Setup the tooltip to object. The object can have only one tooltip,
|
||||
so any previews tooltip data is removed. ``func(owner, tooltip,
|
||||
args, kargs)`` will be called every time that need show the tooltip
|
||||
and it should return a valid Evas_Object. This object is then
|
||||
managed fully by tooltip system and is deleted when the tooltip is
|
||||
gone.
|
||||
Setup the tooltip to object. The object can have only one tooltip, so
|
||||
any previews tooltip data is removed. ``func(owner, item, tooltip,
|
||||
args, kargs)`` will be called every time that need show the tooltip and
|
||||
it should return a valid Evas_Object. This object is then managed fully
|
||||
by tooltip system and is deleted when the tooltip is gone.
|
||||
|
||||
:param func: Function to be create tooltip content, called when
|
||||
need show tooltip.
|
||||
|
@ -495,8 +494,8 @@ cdef class ObjectItem(object):
|
|||
cdef void *cbdata
|
||||
|
||||
data = (func, args, kargs)
|
||||
# FIXME: refleak
|
||||
Py_INCREF(data)
|
||||
# DECREF is in data_del_cb
|
||||
cbdata = <void *>data
|
||||
elm_object_item_tooltip_content_cb_set(self.item, _tooltip_item_content_create,
|
||||
cbdata, _tooltip_item_data_del_cb)
|
||||
|
|
|
@ -42,7 +42,7 @@ cdef Evas_Object *_tooltip_item_content_create(void *data, Evas_Object *o, Evas_
|
|||
tooltip = object_from_instance(t)
|
||||
item = _object_item_to_python(<Elm_Object_Item *>it)
|
||||
(func, args, kargs) = <object>data
|
||||
ret = func(obj, item, *args, **kargs)
|
||||
ret = func(obj, item, tooltip, *args, **kargs)
|
||||
if not ret:
|
||||
return NULL
|
||||
return ret.obj
|
||||
|
|
Loading…
Reference in New Issue