Add activate signal to CellRendererIcon
This commit is contained in:
parent
765de62ab8
commit
a634ecfe14
@ -922,6 +922,10 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
|
||||
class CellRendererIcon(gtk.CellRendererPixbuf):
|
||||
__gtype_name__ = 'SugarCellRendererIcon'
|
||||
|
||||
__gsignals__ = {
|
||||
'activate': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, [object])
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
gobject.GObject.__init__(self)
|
||||
self._buffer = _IconBuffer()
|
||||
@ -983,6 +987,9 @@ class CellRendererIcon(gtk.CellRendererPixbuf):
|
||||
|
||||
gtk.CellRendererPixbuf.do_render(self, window, widget, background_area, cell_area, expose_area, flags)
|
||||
|
||||
def do_activate(self, event, widget, path, background_area, cell_area, flags):
|
||||
self.emit('activate', path)
|
||||
|
||||
def get_icon_state(base_name, perc, step=5):
|
||||
strength = round(perc / step) * step
|
||||
icon_theme = gtk.icon_theme_get_default()
|
||||
|
Loading…
Reference in New Issue
Block a user