Ticket #4343: 0004-CellRendererInvoker-remove-redrawing-when-the-treevi.patch

File 0004-CellRendererInvoker-remove-redrawing-when-the-treevi.patch, 2.5 KB (added by manuq, 8 years ago)
  • src/sugar3/graphics/palettewindow.py

    From 124f6a5bb0529d04d3d55ca942a5d0df5c2e188e Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
    Date: Wed, 20 Mar 2013 23:25:30 -0300
    Subject: [PATCH 4/5] CellRendererInvoker: remove redrawing when the treeview
     path changes - SL #4343
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
    
    Performing a redraw each time the mouse moves inside the cell doesn't
    look good.  Removing the redraw doesn't introduce a visual difference
    and improves performance.
    
    Signed-off-by: Manuel Quiñones <manuq@laptop.org>
    ---
     src/sugar3/graphics/palettewindow.py | 17 -----------------
     1 file changed, 17 deletions(-)
    
    diff --git a/src/sugar3/graphics/palettewindow.py b/src/sugar3/graphics/palettewindow.py
    index 28789f3..d6bfbf2 100644
    a b class CellRendererInvoker(Invoker): 
    14061406            path, column_, x_, y_ = tree_view.get_path_at_pos(int(event.x),
    14071407                                                              int(event.y))
    14081408            if path != self.path:
    1409                 if self.path is not None:
    1410                     self._redraw_path(self.path)
    1411                 if path is not None:
    1412                     self._redraw_path(path)
    14131409                if self.palette is not None:
    14141410                    self.palette.popdown(immediate=True)
    14151411                    self.palette = None
    class CellRendererInvoker(Invoker): 
    14201416                return False
    14211417            self.notify_mouse_enter()
    14221418        else:
    1423             if self.path is not None:
    1424                 self._redraw_path(self.path)
    14251419            self.path = None
    14261420
    14271421            if event.get_source_device().get_source() == \
    class CellRendererInvoker(Invoker): 
    14291423                return False
    14301424            self.notify_mouse_leave()
    14311425
    1432     def _redraw_path(self, path):
    1433         column = None
    1434         for column in self._tree_view.get_columns():
    1435             if self._cell_renderer in column.get_cells():
    1436                 break
    1437         assert column is not None
    1438         area = self._tree_view.get_background_area(path, column)
    1439         x, y = \
    1440             self._tree_view.convert_bin_window_to_widget_coords(area.x, area.y)
    1441         self._tree_view.queue_draw_area(x, y, area.width, area.height)
    1442 
    14431426    def __leave_notify_event_cb(self, widget, event):
    14441427        if event.mode == Gdk.CrossingMode.NORMAL:
    14451428            self.notify_mouse_leave()