gitk: use themed spinboxes

gitk uses classic (non-themed) spinboxes rather than the ttk variants.
Commit d93f1713b0 ("gitk: Use themed tk widgets", 2009-04-17) that added
ttk makes no mention of why ttk:spinboxes were omitted, but this leads
to an inconsistent interface. Let's use the ttk version.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
main^2^2
Mark Levedahl 2025-09-21 09:46:58 -04:00
parent ac8fec7d8d
commit 811b8a34b9
1 changed files with 7 additions and 7 deletions

14
gitk
View File

@ -2656,7 +2656,7 @@ proc makewindow {} {


ttk::label .bleft.mid.labeldiffcontext -text " [mc "Lines of context"]: " ttk::label .bleft.mid.labeldiffcontext -text " [mc "Lines of context"]: "
pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left -ipadx $wgap pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left -ipadx $wgap
spinbox .bleft.mid.diffcontext -width 5 \ ttk::spinbox .bleft.mid.diffcontext -width 5 \
-from 0 -increment 1 -to 10000000 \ -from 0 -increment 1 -to 10000000 \
-validate all -validatecommand "diffcontextvalidate %P" \ -validate all -validatecommand "diffcontextvalidate %P" \
-textvariable diffcontextstring -textvariable diffcontextstring
@ -11692,11 +11692,11 @@ proc prefspage_general {notebook} {
grid $page.ldisp - -sticky w -pady 10 grid $page.ldisp - -sticky w -pady 10
ttk::label $page.spacer -text " " ttk::label $page.spacer -text " "
ttk::label $page.maxwidthl -text [mc "Maximum graph width (lines)"] ttk::label $page.maxwidthl -text [mc "Maximum graph width (lines)"]
spinbox $page.maxwidth -from 0 -to 100 -width 4 -textvariable maxwidth ttk::spinbox $page.maxwidth -from 0 -to 100 -width 4 -textvariable maxwidth
grid $page.spacer $page.maxwidthl $page.maxwidth -sticky w grid $page.spacer $page.maxwidthl $page.maxwidth -sticky w
#xgettext:no-tcl-format #xgettext:no-tcl-format
ttk::label $page.maxpctl -text [mc "Maximum graph width (% of pane)"] ttk::label $page.maxpctl -text [mc "Maximum graph width (% of pane)"]
spinbox $page.maxpct -from 1 -to 100 -width 4 -textvariable maxgraphpct ttk::spinbox $page.maxpct -from 1 -to 100 -width 4 -textvariable maxgraphpct
grid x $page.maxpctl $page.maxpct -sticky w grid x $page.maxpctl $page.maxpct -sticky w
ttk::checkbutton $page.showlocal -text [mc "Show local changes"] \ ttk::checkbutton $page.showlocal -text [mc "Show local changes"] \
-variable showlocalchanges -variable showlocalchanges
@ -11721,17 +11721,17 @@ proc prefspage_general {notebook} {
grid x $page.autoselect -sticky w grid x $page.autoselect -sticky w
} }


spinbox $page.autosellen -from 1 -to $hashlength -width 4 -textvariable autosellen ttk::spinbox $page.autosellen -from 1 -to $hashlength -width 4 -textvariable autosellen
ttk::label $page.autosellenl -text [mc "Length of commit ID to copy"] ttk::label $page.autosellenl -text [mc "Length of commit ID to copy"]
grid x $page.autosellenl $page.autosellen -sticky w grid x $page.autosellenl $page.autosellen -sticky w
ttk::label $page.kscroll1 -text [mc "Wheel scrolling multiplier"] ttk::label $page.kscroll1 -text [mc "Wheel scrolling multiplier"]
spinbox $page.kscroll -from 1 -to 20 -width 4 -textvariable kscroll ttk::spinbox $page.kscroll -from 1 -to 20 -width 4 -textvariable kscroll
grid x $page.kscroll1 $page.kscroll -sticky w grid x $page.kscroll1 $page.kscroll -sticky w


ttk::label $page.ddisp -text [mc "Diff display options"] -font mainfontbold ttk::label $page.ddisp -text [mc "Diff display options"] -font mainfontbold
grid $page.ddisp - -sticky w -pady 10 grid $page.ddisp - -sticky w -pady 10
ttk::label $page.tabstopl -text [mc "Tab spacing"] ttk::label $page.tabstopl -text [mc "Tab spacing"]
spinbox $page.tabstop -from 1 -to 20 -width 4 -textvariable tabstop ttk::spinbox $page.tabstop -from 1 -to 20 -width 4 -textvariable tabstop
grid x $page.tabstopl $page.tabstop -sticky w grid x $page.tabstopl $page.tabstop -sticky w


ttk::label $page.wrapcommentl -text [mc "Wrap comment text"] ttk::label $page.wrapcommentl -text [mc "Wrap comment text"]
@ -11746,7 +11746,7 @@ proc prefspage_general {notebook} {
-variable showneartags -variable showneartags
grid x $page.ntag -sticky w grid x $page.ntag -sticky w
ttk::label $page.maxrefsl -text [mc "Maximum # tags/heads to show"] ttk::label $page.maxrefsl -text [mc "Maximum # tags/heads to show"]
spinbox $page.maxrefs -from 1 -to 1000 -width 4 -textvariable maxrefs ttk::spinbox $page.maxrefs -from 1 -to 1000 -width 4 -textvariable maxrefs
grid x $page.maxrefsl $page.maxrefs -sticky w grid x $page.maxrefsl $page.maxrefs -sticky w
ttk::checkbutton $page.ldiff -text [mc "Limit diffs to listed paths"] \ ttk::checkbutton $page.ldiff -text [mc "Limit diffs to listed paths"] \
-variable limitdiffs -variable limitdiffs