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>
This commit is contained in:
Gabriele Mazzotta 2014-11-15 15:05:06 +01:00 committed by Paul Mackerras
parent e203d1dcba
commit 122b807992

7
gitk
View File

@ -2516,6 +2516,13 @@ proc makewindow {} {
} 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)}]