Handle cell activation by button-release
This commit is contained in:
parent
985edb0e4d
commit
434b1e5899
@ -1033,10 +1033,12 @@ class CellRendererIcon(gtk.GenericCellRenderer):
|
|||||||
|
|
||||||
return xoffset, yoffset, width, height
|
return xoffset, yoffset, width, height
|
||||||
|
|
||||||
def on_activate(self, event, widget, path, background_area, cell_area, flags):
|
def on_activate(self, event, widget, path, background_area, cell_area,
|
||||||
self.emit('activate', path)
|
flags):
|
||||||
|
pass
|
||||||
|
|
||||||
def on_start_editing(self, event, widget, path, background_area, cell_area, flags):
|
def on_start_editing(self, event, widget, path, background_area, cell_area,
|
||||||
|
flags):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def _is_prelit(self, tree_view):
|
def _is_prelit(self, tree_view):
|
||||||
|
@ -1230,6 +1230,13 @@ class CellRendererInvoker(Invoker):
|
|||||||
self.notify_mouse_leave()
|
self.notify_mouse_leave()
|
||||||
|
|
||||||
def __button_release_event_cb(self, widget, event):
|
def __button_release_event_cb(self, widget, event):
|
||||||
|
if event.button == 1 and self._point_in_cell_renderer(event.x, event.y):
|
||||||
|
tree_view = self._tree_view
|
||||||
|
path, column_, x_, y_ = tree_view.get_path_at_pos(int(event.x),
|
||||||
|
int(event.y))
|
||||||
|
self._cell_renderer.emit('activate', path)
|
||||||
|
# So the treeview receives it and knows a drag isn't going on
|
||||||
|
return False
|
||||||
if event.button == 3 and self._point_in_cell_renderer(event.x, event.y):
|
if event.button == 3 and self._point_in_cell_renderer(event.x, event.y):
|
||||||
self.notify_right_click()
|
self.notify_right_click()
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user