Skip to content

Commit 3e43143

Browse files
committed
gitk: allow horizontal commit-graph scrolling
gitk commit 5fdcbb1 ("gitk: Fixes for Mac OS X TkAqua", 2009-03-23), adds horizontal scrolling of the commit graph pane on aqua, but not on x11 or win32. Also, the horizontal scrolling is triggered by MouseWheel events attached to any of the three panes, not just the commit graph that is the only one that scrolls. It is unusual to scroll a widget that is not under the mouse, many would consider this a bug. No horizontal scrollbar is provided for this, so there is no real cue for the user that horizontal scrolling is available. We removed this aqua only feature by transitioning aqua to use the common MouseWheel bindings set. Let's add this as a feature on all platforms, and use the same approach for scaling scroll motion as we do elsewhere. For horizontal scrolling, honor only events received by the commit graph in conformance with normal GUI design. Vertical scrolling is unchanged, and events received by any of the 3 panes continue to scroll all 3 in unison. Per the ancient and long ignored CUA standards, we should add a horizontal scrollbar to the commit-graph, but gitk's interface is already very cluttered: adding a scrollbar to only one of these three panes is difficult while maintaining common pane vertical size, especially so considering the movable sash separating panes 1 & 2, and will consume yet more space. So, leave this as a hidden feature, now available on all platforms. Signed-off-by: Mark Levedahl <[email protected]>
1 parent 24fb77a commit 3e43143

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gitk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2272,6 +2272,7 @@ proc bind_mousewheel {} {
22722272
bind $ctext <Shift-MouseWheel> {$ctext xview scroll [scrollval %D 2] units}
22732273
bind $cflist <MouseWheel> {$cflist yview scroll [scrollval %D 2] units}
22742274
bind $cflist <Shift-MouseWheel> break
2275+
bind $canv <Shift-MouseWheel> {$canv xview scroll [scrollval %D] units}
22752276
}
22762277
22772278
proc bind_mousewheel_buttons {} {
@@ -2288,6 +2289,8 @@ proc bind_mousewheel_buttons {} {
22882289
bind $cflist <ButtonRelease-5> {$cflist yview scroll [scrollval -1 2] units}
22892290
bind $cflist <Shift-ButtonRelease-4> break
22902291
bind $cflist <Shift-ButtonRelease-5> break
2292+
bind $canv <Shift-ButtonRelease-4> {$canv xview scroll [scrollval 1] units}
2293+
bind $canv <Shift-ButtonRelease-5> {$canv xview scroll [scrollval -1] units}
22912294
}
22922295
22932296
proc makewindow {} {
@@ -2388,6 +2391,7 @@ proc makewindow {} {
23882391
canvas $canv \
23892392
-selectbackground $selectbgcolor \
23902393
-background $bgcolor -bd 0 \
2394+
-xscrollincr $linespc \
23912395
-yscrollincr $linespc -yscrollcommand "scrollcanv $cscroll"
23922396
.tf.histframe.pwclist add $canv
23932397
set canv2 .tf.histframe.pwclist.canv2

0 commit comments

Comments
 (0)