[meld] filediff: Add some detailed comments on how scrollbar influence works
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] filediff: Add some detailed comments on how scrollbar influence works
- Date: Tue, 25 Apr 2017 01:57:09 +0000 (UTC)
commit f51f37f743bf1c91679a362523677d7ff982de62
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Apr 9 08:40:01 2017 +1000
filediff: Add some detailed comments on how scrollbar influence works
meld/filediff.py | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index a16f9c9..e9aa0d9 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1660,7 +1660,17 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
line_y, height = self.textview[master].get_line_yrange(it)
line = it.get_line() + ((master_y-line_y)/height)
- # scrollbar influence 0->1->2 or 0<-1->2 or 0<-1<-2
+ # In the case of two pane scrolling, it's clear how to bind
+ # scrollbars: if the user moves the left pane, we move the
+ # right pane, and vice versa.
+ #
+ # For three pane scrolling, we want panes to be tied, but need
+ # an influence mapping. In Meld, all influence flows through
+ # the middle pane, e.g., the user moves the left pane, that
+ # moves the middle pane, and the middle pane moves the right
+ # pane. If the user moves the middle pane, then the left and
+ # right panes are moved directly.
+
scrollbar_influence = ((1, 2), (0, 2), (1, 0))
for i in scrollbar_influence[master][:self.num_panes - 1]:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]