@@ -2606,7 +2606,7 @@ proc savestuff {w} {
2606
2606
global cmitmode wrapcomment datetimeformat limitdiffs
2607
2607
global colors bgcolor fgcolor diffcolors diffcontext selectbgcolor
2608
2608
global autoselect extdifftool perfile_attrs markbgcolor use_ttk
2609
- global hideremotes
2609
+ global hideremotes want_ttk
2610
2610
2611
2611
if {$stuffsaved } return
2612
2612
if {![winfo viewable .]} return
@@ -2630,6 +2630,7 @@ proc savestuff {w} {
2630
2630
puts $f [list set showlocalchanges $showlocalchanges ]
2631
2631
puts $f [list set datetimeformat $datetimeformat ]
2632
2632
puts $f [list set limitdiffs $limitdiffs ]
2633
+ puts $f [list set want_ttk $want_ttk ]
2633
2634
puts $f [list set bgcolor $bgcolor ]
2634
2635
puts $f [list set fgcolor $fgcolor ]
2635
2636
puts $f [list set colors $colors ]
@@ -10586,7 +10587,7 @@ proc doprefs {} {
10586
10587
global oldprefs prefstop showneartags showlocalchanges
10587
10588
global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
10588
10589
global tabstop limitdiffs autoselect extdifftool perfile_attrs
10589
- global hideremotes
10590
+ global hideremotes want_ttk have_ttk
10590
10591
10591
10592
set top .gitkprefs
10592
10593
set prefstop $top
@@ -10595,7 +10596,7 @@ proc doprefs {} {
10595
10596
return
10596
10597
}
10597
10598
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
10598
- limitdiffs tabstop perfile_attrs hideremotes} {
10599
+ limitdiffs tabstop perfile_attrs hideremotes want_ttk } {
10599
10600
set oldprefs($v ) [set $v ]
10600
10601
}
10601
10602
ttk_toplevel $top
@@ -10616,6 +10617,9 @@ proc doprefs {} {
10616
10617
${NS} ::checkbutton $top .autoselect -text [mc " Auto-select SHA1" ] \
10617
10618
-variable autoselect
10618
10619
grid x $top .autoselect -sticky w
10620
+ ${NS} ::checkbutton $top .hideremotes -text [mc " Hide remote refs" ] \
10621
+ -variable hideremotes
10622
+ grid x $top .hideremotes -sticky w
10619
10623
10620
10624
${NS} ::label $top .ddisp -text [mc " Diff display options" ]
10621
10625
grid $top .ddisp - -sticky w -pady 10
@@ -10625,9 +10629,6 @@ proc doprefs {} {
10625
10629
${NS} ::checkbutton $top .ntag -text [mc " Display nearby tags" ] \
10626
10630
-variable showneartags
10627
10631
grid x $top .ntag -sticky w
10628
- ${NS} ::checkbutton $top .hideremotes -text [mc " Hide remote refs" ] \
10629
- -variable hideremotes
10630
- grid x $top .hideremotes -sticky w
10631
10632
${NS} ::checkbutton $top .ldiff -text [mc " Limit diffs to listed paths" ] \
10632
10633
-variable limitdiffs
10633
10634
grid x $top .ldiff -sticky w
@@ -10643,6 +10644,17 @@ proc doprefs {} {
10643
10644
pack configure $top .extdifff.l -padx 10
10644
10645
grid x $top .extdifff $top .extdifft -sticky ew
10645
10646
10647
+ ${NS} ::label $top .lgen -text [mc " General options" ]
10648
+ grid $top .lgen - -sticky w -pady 10
10649
+ ${NS} ::checkbutton $top .want_ttk -variable want_ttk \
10650
+ -text [mc " Use themed widgets" ]
10651
+ if {$have_ttk } {
10652
+ ${NS} ::label $top .ttk_note -text [mc " (change requires restart)" ]
10653
+ } else {
10654
+ ${NS} ::label $top .ttk_note -text [mc " (currently unavailable)" ]
10655
+ }
10656
+ grid x $top .want_ttk $top .ttk_note -sticky w
10657
+
10646
10658
${NS} ::label $top .cdisp -text [mc " Colors: press to choose" ]
10647
10659
grid $top .cdisp - -sticky w -pady 10
10648
10660
label $top .bg -padx 40 -relief sunk -background $bgcolor
@@ -10689,7 +10701,8 @@ proc doprefs {} {
10689
10701
if {!$use_ttk } {
10690
10702
foreach w {maxpctl maxwidthl showlocal autoselect tabstopl ntag
10691
10703
ldiff lattr extdifff.l extdifff.b bgbut fgbut
10692
- diffoldbut diffnewbut hunksepbut markbgbut selbgbut} {
10704
+ diffoldbut diffnewbut hunksepbut markbgbut selbgbut
10705
+ want_ttk ttk_note} {
10693
10706
$top .$w configure -font optionfont
10694
10707
}
10695
10708
}
@@ -10760,7 +10773,7 @@ proc prefscan {} {
10760
10773
global oldprefs prefstop
10761
10774
10762
10775
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
10763
- limitdiffs tabstop perfile_attrs hideremotes} {
10776
+ limitdiffs tabstop perfile_attrs hideremotes want_ttk } {
10764
10777
global $v
10765
10778
set $v $oldprefs($v)
10766
10779
}
@@ -11236,6 +11249,7 @@ set limitdiffs 1
11236
11249
set datetimeformat " %Y-%m-%d %H:%M:%S"
11237
11250
set autoselect 1
11238
11251
set perfile_attrs 0
11252
+ set want_ttk 1
11239
11253
11240
11254
if {[tk windowingsystem] eq " aqua" } {
11241
11255
set extdifftool " opendiff"
@@ -11372,10 +11386,12 @@ set nullid2 "0000000000000000000000000000000000000001"
11372
11386
set nullfile " /dev/null"
11373
11387
11374
11388
set have_tk85 [expr {[package vcompare $tk_version " 8.5" ] >= 0}]
11375
- if {![info exists use_ttk ]} {
11376
- set use_ttk [llength [info commands ::ttk::style]]
11389
+ if {![info exists have_ttk ]} {
11390
+ set have_ttk [llength [info commands ::ttk::style]]
11377
11391
}
11392
+ set use_ttk [expr {$have_ttk && $want_ttk }]
11378
11393
set NS [expr {$use_ttk ? " ttk" : " " }]
11394
+
11379
11395
set git_version [join [lrange [split [lindex [exec git version] end] .] 0 2] .]
11380
11396
11381
11397
set runq {}
0 commit comments