Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@sugarlabs.org>2009-06-27 16:04:00 (GMT)
committer Tomeu Vizoso <tomeu@sugarlabs.org>2009-06-27 16:04:00 (GMT)
commit434b1e5899eb81ef0f34cc9172428896a2278033 (patch)
tree78014145f4b80531f7e0c4ccdc8aa2f5f4ddd097
parent985edb0e4db5b0579373d140d3a34f2fa1428360 (diff)
Handle cell activation by button-release
-rw-r--r--src/sugar/graphics/icon.py8
-rw-r--r--src/sugar/graphics/palette.py7
2 files changed, 12 insertions, 3 deletions
diff --git a/src/sugar/graphics/icon.py b/src/sugar/graphics/icon.py
index 223ec98..fff0a1a 100644
--- a/src/sugar/graphics/icon.py
+++ b/src/sugar/graphics/icon.py
@@ -1033,10 +1033,12 @@ class CellRendererIcon(gtk.GenericCellRenderer):
return xoffset, yoffset, width, height
- def on_activate(self, event, widget, path, background_area, cell_area, flags):
- self.emit('activate', path)
+ def on_activate(self, event, widget, path, background_area, cell_area,
+ 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
def _is_prelit(self, tree_view):
diff --git a/src/sugar/graphics/palette.py b/src/sugar/graphics/palette.py
index 2c47950..0ad7f0e 100644
--- a/src/sugar/graphics/palette.py
+++ b/src/sugar/graphics/palette.py
@@ -1230,6 +1230,13 @@ class CellRendererInvoker(Invoker):
self.notify_mouse_leave()
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):
self.notify_right_click()
return True