[meld] Clean up horizontal scroll handling



commit 1669528f85c3c3f89a68957366efcae617350c19
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Oct 11 17:34:06 2009 +1000

    Clean up horizontal scroll handling

 meld/filediff.py |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 27b2c10..003fd8c 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1081,14 +1081,16 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
         # scrollbars
         #
     def _sync_hscroll(self, adjustment):
-        if not self._sync_hscroll_lock:
-            self._sync_hscroll_lock = True
-            adjs = map( lambda x: x.get_hadjustment(), self.scrolledwindow)
-            adjs.remove(adjustment)
-            val = adjustment.get_value()
-            for a in adjs:
-                a.set_value(val)
-            self._sync_hscroll_lock = False
+        if self._sync_hscroll_lock:
+            return
+
+        self._sync_hscroll_lock = True
+        val = adjustment.get_value()
+        for sw in self.scrolledwindow[:self.num_panes]:
+            adj = sw.get_hadjustment()
+            if adj is not adjustment:
+                adj.set_value(val)
+        self._sync_hscroll_lock = False
 
     def _sync_vscroll(self, adjustment, master):
         # only allow one scrollbar to be here at a time



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