[Pkg-sugar-commit] [sugar-toolkit] 25/118: Redraw cell renderers on hovering changed

Jonas Smedegaard dr at jones.dk
Thu Apr 16 18:49:36 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/0.84.10-1
in repository sugar-toolkit.

commit 81fc651a1b9aa3d4413f50e60bb828d9ab707d77
Author: Tomeu Vizoso <tomeu at sugarlabs.org>
Date:   Sat Jun 13 20:56:37 2009 +0200

    Redraw cell renderers on hovering changed
---
 src/sugar/graphics/palette.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/sugar/graphics/palette.py b/src/sugar/graphics/palette.py
index f94f4bc..3419e52 100644
--- a/src/sugar/graphics/palette.py
+++ b/src/sugar/graphics/palette.py
@@ -1203,6 +1203,10 @@ class CellRendererInvoker(Invoker):
             path, column_, x_, y_ = tree_view.get_path_at_pos(int(event.x),
                                                               int(event.y))
             if path != self.path:
+                if self.path is not None:
+                    self._redraw_path(self.path)
+                if path is not None:
+                    self._redraw_path(path)
                 if self.palette is not None:
                     self.palette.popdown(immediate=True)
                     self.palette = None
@@ -1210,9 +1214,19 @@ class CellRendererInvoker(Invoker):
 
             self.notify_mouse_enter()
         else:
+            if self.path is not None:
+                self._redraw_path(self.path)
             self.path = None
             self.notify_mouse_leave()
 
+    def _redraw_path(self, path):
+        for column in self._tree_view.get_columns():
+            if self._cell_renderer in column.get_cell_renderers():
+                break
+        area = self._tree_view.get_background_area(path, column)
+        x, y = self._tree_view.convert_tree_to_widget_coords(area.x, area.y)
+        self._tree_view.queue_draw_area(x, y, area.width, area.height)
+
     def __leave_notify_event_cb(self, widget, event):
         self.notify_mouse_leave()
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-sugar/sugar-toolkit.git



More information about the pkg-sugar-commit mailing list