gitk: Enable mouse horizontal scrolling in diff pane

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>

Gabriele Mazzotta committed Nov 15, 2014 at 15:05 UTC 122b80799249be33e66a4f716fdca6d80635a05e
1 file changed +7
gitk
+7
@@ -2516,6 +2516,13 @@ proc makewindow {} {
2516 } else {
2517 bindall <ButtonRelease-4> "allcanvs yview scroll -5 units"
2518 bindall <ButtonRelease-5> "allcanvs yview scroll 5 units"
2519 + bind $ctext <Button> {
2520 + if {"%b" eq 6} {
2521 + $ctext xview scroll -5 units
2522 + } elseif {"%b" eq 7} {
2523 + $ctext xview scroll 5 units
2524 + }
2525 + }
2526 if {[tk windowingsystem] eq "aqua"} {
2527 bindall <MouseWheel> {
2528 set delta [expr {- (%D)}]