aboutsummaryrefslogtreecommitdiffstats
path: root/gitk
diff options
context:
space:
mode:
authorMark Levedahl <mlevedahl@gmail.com>2025-06-03 15:04:27 -0400
committerMark Levedahl <mlevedahl@gmail.com>2025-07-16 23:01:51 -0400
commit24fb77a2a8218017ca38e28165eec4f9b7be141d (patch)
tree160275d35d1d09e29bf6fcf9ecc56cfad4b0bd1c /gitk
parent82f0b92683a5219587b86d8625110746d2e767b4 (diff)
downloadgit-24fb77a2a8218017ca38e28165eec4f9b7be141d.tar.gz
gitk: update aqua scrolling for TclTk 8.6 / TIP171
Tk provides MouseWheel events to aqua, similar to win32. But, these events on aqua have a nominal motion value (%D) of 1, not 120 as on win32. gitk on aqua provides specific bindings only for the top 3 panes, giving a nominal scrolling amount of +/- 1 for all events. gitk includes a hidden feature providing horizontal scrolling of the commit graph, added in 5fdcbb1390 ("gitk: Fixes for Mac OS X TkAqua", 2009-03-23). This horizontal scrolling is triggered by mouse events in any of the top 3 panes, and thus violates normal gui design where the object under the mouse cursor scrolls. Let's update this using the common bindings in 'proc bind_mousewheel', allowing user preferences on motion scaling to apply to all windows. The commit graph scrolling feature is removed by this, and will be added back for all platforms in a later commit. Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Diffstat (limited to 'gitk')
-rwxr-xr-xgitk10
1 files changed, 2 insertions, 8 deletions
diff --git a/gitk b/gitk
index dd36e4c1b9..bd57a55466 100755
--- a/gitk
+++ b/gitk
@@ -2735,14 +2735,8 @@ proc makewindow {} {
set scroll_D0 1
bind_mousewheel_buttons
} elseif {[tk windowingsystem] == "aqua"} {
- bindall <MouseWheel> {
- set delta [expr {- (%D)}]
- allcanvs yview scroll $delta units
- }
- bindall <Shift-MouseWheel> {
- set delta [expr {- (%D)}]
- $canv xview scroll $delta units
- }
+ set scroll_D0 1
+ bind_mousewheel
} else {
puts stderr [mc "Unknown windowing system, cannot bind mouse"]
}