[meld/meld-3-14] diffmap: Fix scrollbar-alignment code for new GTK+ allocation behaviour



commit 3595b136f217ab7001ee5febff9877e3603c18cb
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Oct 3 12:11:05 2015 +1000

    diffmap: Fix scrollbar-alignment code for new GTK+ allocation behaviour
    
    There's still a few areas of somewhat-internal hackery here in handling
    the scrollbar's style properties and allocations, but this works for
    now at least.

 meld/diffmap.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/meld/diffmap.py b/meld/diffmap.py
index 633c195..c933d9d 100644
--- a/meld/diffmap.py
+++ b/meld/diffmap.py
@@ -103,7 +103,8 @@ class DiffMap(Gtk.DrawingArea):
         self.queue_draw()
 
     def on_scrollbar_size_allocate(self, scrollbar, allocation):
-        self._scroll_y = allocation.y
+        translation = scrollbar.translate_coordinates(self, 0, 0)
+        self._scroll_y = translation[1] if translation else 0
         self._scroll_height = allocation.height
         self._width = max(allocation.width, 10)
         self._cached_map = None
@@ -113,7 +114,7 @@ class DiffMap(Gtk.DrawingArea):
         if not self._setup:
             return
         height = self._scroll_height - self._h_offset - 1
-        y_start = self._scroll_y - self.get_allocation().y - self._y_offset + 1
+        y_start = self._scroll_y + self._y_offset + 1
         width = self.get_allocated_width()
         xpad = 2.5
         x0 = xpad


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]