Skip to content

Commit 122b807

Browse files
gm-vmpaulusmack
authored andcommitted
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>
1 parent e203d1d commit 122b807

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

gitk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2516,6 +2516,13 @@ proc makewindow {} {
25162516
} else {
25172517
bindall <ButtonRelease-4> "allcanvs yview scroll -5 units"
25182518
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+
}
25192526
if {[tk windowingsystem] eq "aqua"} {
25202527
bindall <MouseWheel> {
25212528
set delta [expr {- (%D)}]

0 commit comments

Comments
 (0)