gitk: Enable mouse horizontal scrolling in diff pane
authorGabriele Mazzotta <gabriele.mzt@gmail.com>
Sat, 15 Nov 2014 14:05:06 +0000 (15:05 +0100)
committerPaul Mackerras <paulus@samba.org>
Mon, 2 Mar 2015 00:29:59 +0000 (11:29 +1100)
Currently it's required to hold Shift and scroll up and down to move
horizontally. Listen to Button-6 and Button-7 events too to make
horizontal scrolling handier with touchpads and some mice.

Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk

diff --git a/gitk b/gitk
index 462f966..d42f283 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -2516,6 +2516,13 @@ proc makewindow {} {
     } else {
        bindall <ButtonRelease-4> "allcanvs yview scroll -5 units"
        bindall <ButtonRelease-5> "allcanvs yview scroll 5 units"
     } else {
        bindall <ButtonRelease-4> "allcanvs yview scroll -5 units"
        bindall <ButtonRelease-5> "allcanvs yview scroll 5 units"
+       bind $ctext <Button> {
+           if {"%b" eq 6} {
+               $ctext xview scroll -5 units
+           } elseif {"%b" eq 7} {
+               $ctext xview scroll 5 units
+           }
+       }
         if {[tk windowingsystem] eq "aqua"} {
             bindall <MouseWheel> {
                 set delta [expr {- (%D)}]
         if {[tk windowingsystem] eq "aqua"} {
             bindall <MouseWheel> {
                 set delta [expr {- (%D)}]