From: Mark Levedahl Date: Tue, 3 Jun 2025 11:36:44 +0000 (-0400) Subject: gitk: wheel scrolling multiplier preference X-Git-Tag: v2.51.0-rc0~47^2~1^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ec02983e8da3ec625092792651e64aef45b778e1;p=thirdparty%2Fgit.git gitk: wheel scrolling multiplier preference gitk provides scrolling of several windows, uses hard-coded values for the amount of scrolling, and these values differ across platforms and widgets. The nominal value used is either 1 text line per mouse / touchpad / button event, or 5 lines. Furthermore, Tk does not scroll text widgets by 1 line when told to, this usually gets 2-3 lines of motion. The upper canvas objects holding the commit graph do scroll as defined. But, clearly no value is universally preferred, so let's give the user some control over this. Provide a single multiplier to be applied for all scroll bindings, with a value of 3 to mean the default nominal value of 3 line. This is selected both as a compromise between the various defaults across platforms, and because it is the smallest value honored by the two text widgets on the bottom of the screen. Later commits will connect this variable for actual scrolling events. Signed-off-by: Mark Levedahl --- diff --git a/gitk b/gitk index 8b3476c516..0596e4382a 100755 --- a/gitk +++ b/gitk @@ -11593,6 +11593,9 @@ proc prefspage_general {notebook} { spinbox $page.autosellen -from 1 -to 40 -width 4 -textvariable autosellen ttk::label $page.autosellenl -text [mc "Length of commit ID to copy"] grid x $page.autosellenl $page.autosellen -sticky w + ttk::label $page.kscroll1 -text [mc "Wheel scrolling multiplier"] + spinbox $page.kscroll -from 1 -to 20 -width 4 -textvariable kscroll + grid x $page.kscroll1 $page.kscroll -sticky w ttk::label $page.ddisp -text [mc "Diff display options"] -font mainfontbold grid $page.ddisp - -sticky w -pady 10 @@ -12369,6 +12372,7 @@ set visiblerefs {"master"} set maxlinelen 200 set showlocalchanges 1 set limitdiffs 1 +set kscroll 3 set datetimeformat "%Y-%m-%d %H:%M:%S" set autocopy 0 set autoselect 1 @@ -12490,6 +12494,7 @@ set config_variables { headoutlinecolor hideremotes indexcirclecolor + kscroll limitdiffs linehoverbgcolor linehoverfgcolor