@@ -1348,6 +1348,19 @@ proc confirm_popup msg {
13481348 return $confirm_ok
13491349}
13501350
1351+ proc setoptions {} {
1352+ option add *Panedwindow.showHandle 1 startupFile
1353+ option add *Panedwindow.sashRelief raised startupFile
1354+ option add *Button.font uifont startupFile
1355+ option add *Checkbutton.font uifont startupFile
1356+ option add *Radiobutton.font uifont startupFile
1357+ option add *Menu.font uifont startupFile
1358+ option add *Menubutton.font uifont startupFile
1359+ option add *Label.font uifont startupFile
1360+ option add *Message.font uifont startupFile
1361+ option add *Entry.font uifont startupFile
1362+ }
1363+
13511364proc makewindow {} {
13521365 global canv canv2 canv3 linespc charspc ctext cflist cscroll
13531366 global tabstop
@@ -1366,20 +1379,17 @@ proc makewindow {} {
13661379
13671380 menu .bar
13681381 .bar add cascade -label [mc " File" ] -menu .bar.file
1369- .bar configure -font uifont
13701382 menu .bar.file
13711383 .bar.file add command -label [mc " Update" ] -command updatecommits
13721384 .bar.file add command -label [mc " Reload" ] -command reloadcommits
13731385 .bar.file add command -label [mc " Reread references" ] -command rereadrefs
13741386 .bar.file add command -label [mc " List references" ] -command showrefs
13751387 .bar.file add command -label [mc " Quit" ] -command doquit
1376- .bar.file configure -font uifont
13771388 menu .bar.edit
13781389 .bar add cascade -label [mc " Edit" ] -menu .bar.edit
13791390 .bar.edit add command -label [mc " Preferences" ] -command doprefs
1380- .bar.edit configure -font uifont
13811391
1382- menu .bar.view -font uifont
1392+ menu .bar.view
13831393 .bar add cascade -label [mc " View" ] -menu .bar.view
13841394 .bar.view add command -label [mc " New view..." ] -command {newview 0}
13851395 .bar.view add command -label [mc " Edit view..." ] -command editview \
@@ -1393,7 +1403,7 @@ proc makewindow {} {
13931403 .bar add cascade -label [mc " Help" ] -menu .bar.help
13941404 .bar.help add command -label [mc " About gitk" ] -command about
13951405 .bar.help add command -label [mc " Key bindings" ] -command keys
1396- .bar.help configure -font uifont
1406+ .bar.help configure
13971407 . configure -menu .bar
13981408
13991409 # the gui has upper and lower half, parts of a paned window.
@@ -1450,7 +1460,7 @@ proc makewindow {} {
14501460 set entries $sha1entry
14511461 set sha1but .tf.bar.sha1label
14521462 button $sha1but -text [mc " SHA1 ID: " ] -state disabled -relief flat \
1453- -command gotocommit -width 8 -font uifont
1463+ -command gotocommit -width 8
14541464 $sha1but conf -disabledforeground [$sha1but cget -foreground]
14551465 pack .tf.bar.sha1label -side left
14561466 entry $sha1entry -width 40 -font textfont -textvariable sha1string
@@ -1482,7 +1492,7 @@ proc makewindow {} {
14821492
14831493 # Status label and progress bar
14841494 set statusw .tf.bar.status
1485- label $statusw -width 15 -relief sunken -font uifont
1495+ label $statusw -width 15 -relief sunken
14861496 pack $statusw -side left -padx 5
14871497 set h [expr {[font metrics uifont -linespace] + 2}]
14881498 set progresscanv .tf.bar.progress
@@ -1499,10 +1509,10 @@ proc makewindow {} {
14991509 set progupdatepending 0
15001510
15011511 # build up the bottom bar of upper window
1502- label .tf.lbar.flabel -text " [ mc " Find" ] " -font uifont
1503- button .tf.lbar.fnext -text [mc " next" ] -command {dofind 1 1} -font uifont
1504- button .tf.lbar.fprev -text [mc " prev" ] -command {dofind -1 1} -font uifont
1505- label .tf.lbar.flab2 -text " [ mc " commit" ] " -font uifont
1512+ label .tf.lbar.flabel -text " [ mc " Find" ] "
1513+ button .tf.lbar.fnext -text [mc " next" ] -command {dofind 1 1}
1514+ button .tf.lbar.fprev -text [mc " prev" ] -command {dofind -1 1}
1515+ label .tf.lbar.flab2 -text " [ mc " commit" ] "
15061516 pack .tf.lbar.flabel .tf.lbar.fnext .tf.lbar.fprev .tf.lbar.flab2 \
15071517 -side left -fill y
15081518 set gdttype [mc " containing:" ]
@@ -1511,8 +1521,6 @@ proc makewindow {} {
15111521 [mc " touching paths:" ] \
15121522 [mc " adding/removing string:" ]]
15131523 trace add variable gdttype write gdttype_change
1514- $gm conf -font uifont
1515- .tf.lbar.gdttype conf -font uifont
15161524 pack .tf.lbar.gdttype -side left -fill y
15171525
15181526 set findstring {}
@@ -1524,14 +1532,10 @@ proc makewindow {} {
15241532 set findtypemenu [tk_optionMenu .tf.lbar.findtype \
15251533 findtype [mc " Exact" ] [mc " IgnCase" ] [mc " Regexp" ]]
15261534 trace add variable findtype write findcom_change
1527- .tf.lbar.findtype configure -font uifont
1528- .tf.lbar.findtype.menu configure -font uifont
15291535 set findloc [mc " All fields" ]
15301536 tk_optionMenu .tf.lbar.findloc findloc [mc " All fields" ] [mc " Headline" ] \
15311537 [mc " Comments" ] [mc " Author" ] [mc " Committer" ]
15321538 trace add variable findloc write find_change
1533- .tf.lbar.findloc configure -font uifont
1534- .tf.lbar.findloc.menu configure -font uifont
15351539 pack .tf.lbar.findloc -side right
15361540 pack .tf.lbar.findtype -side right
15371541 pack $fstring -side left -expand 1 -fill x
@@ -1558,22 +1562,20 @@ proc makewindow {} {
15581562 frame .bleft.top
15591563 frame .bleft.mid
15601564
1561- button .bleft.top.search -text [mc " Search" ] -command dosearch \
1562- -font uifont
1565+ button .bleft.top.search -text [mc " Search" ] -command dosearch
15631566 pack .bleft.top.search -side left -padx 5
15641567 set sstring .bleft.top.sstring
15651568 entry $sstring -width 20 -font textfont -textvariable searchstring
15661569 lappend entries $sstring
15671570 trace add variable searchstring write incrsearch
15681571 pack $sstring -side left -expand 1 -fill x
1569- radiobutton .bleft.mid.diff -text [mc " Diff" ] -font uifont \
1572+ radiobutton .bleft.mid.diff -text [mc " Diff" ] \
15701573 -command changediffdisp -variable diffelide -value {0 0}
1571- radiobutton .bleft.mid.old -text [mc " Old version" ] -font uifont \
1574+ radiobutton .bleft.mid.old -text [mc " Old version" ] \
15721575 -command changediffdisp -variable diffelide -value {0 1}
1573- radiobutton .bleft.mid.new -text [mc " New version" ] -font uifont \
1576+ radiobutton .bleft.mid.new -text [mc " New version" ] \
15741577 -command changediffdisp -variable diffelide -value {1 0}
1575- label .bleft.mid.labeldiffcontext -text " [ mc " Lines of context" ] : " \
1576- -font uifont
1578+ label .bleft.mid.labeldiffcontext -text " [ mc " Lines of context" ] : "
15771579 pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left
15781580 spinbox .bleft.mid.diffcontext -width 5 -font textfont \
15791581 -from 1 -increment 1 -to 10000000 \
@@ -1633,10 +1635,8 @@ proc makewindow {} {
16331635 frame .bright.mode
16341636 radiobutton .bright.mode.patch -text [mc " Patch" ] \
16351637 -command reselectline -variable cmitmode -value " patch"
1636- .bright.mode.patch configure -font uifont
16371638 radiobutton .bright.mode.tree -text [mc " Tree" ] \
16381639 -command reselectline -variable cmitmode -value " tree"
1639- .bright.mode.tree configure -font uifont
16401640 grid .bright.mode.patch .bright.mode.tree -sticky ew
16411641 pack .bright.mode -side top -fill x
16421642 set cflist .bright.cfiles
@@ -2022,17 +2022,14 @@ Copyright © 2005-2006 Paul Mackerras
20222022Use and redistribute under the terms of the GNU General Public License" ] \
20232023 -justify center -aspect 400 -border 2 -bg white -relief groove
20242024 pack $w .m -side top -fill x -padx 2 -pady 2
2025- $w .m configure -font uifont
20262025 button $w .ok -text [mc " Close" ] -command " destroy $w " -default active
20272026 pack $w .ok -side bottom
2028- $w .ok configure -font uifont
20292027 bind $w <Visibility> " focus $w .ok"
20302028 bind $w <Key-Escape> " destroy $w "
20312029 bind $w <Key-Return> " destroy $w "
20322030}
20332031
20342032proc keys {} {
2035- global uifont
20362033 set w .keys
20372034 if {[winfo exists $w ]} {
20382035 raise $w
@@ -2086,10 +2083,8 @@ f Scroll diff view to next file
20862083" ] \
20872084 -justify left -bg white -border 2 -relief groove
20882085 pack $w .m -side top -fill both -padx 2 -pady 2
2089- $w .m configure -font uifont
20902086 button $w .ok -text [mc " Close" ] -command " destroy $w " -default active
20912087 pack $w .ok -side bottom
2092- $w .ok configure -font uifont
20932088 bind $w <Visibility> " focus $w .ok"
20942089 bind $w <Key-Escape> " destroy $w "
20952090 bind $w <Key-Return> " destroy $w "
@@ -2584,7 +2579,7 @@ proc shellsplit {str} {
25842579# Code to implement multiple views
25852580
25862581proc newview {ishighlight} {
2587- global nextviewnum newviewname newviewperm uifont newishighlight
2582+ global nextviewnum newviewname newviewperm newishighlight
25882583 global newviewargs revtreeargs
25892584
25902585 set newishighlight $ishighlight
@@ -2617,23 +2612,22 @@ proc editview {} {
26172612
26182613proc vieweditor {top n title} {
26192614 global newviewname newviewperm viewfiles
2620- global uifont
26212615
26222616 toplevel $top
26232617 wm title $top $title
2624- label $top .nl -text [mc " Name" ] -font uifont
2625- entry $top .name -width 20 -textvariable newviewname($n ) -font uifont
2618+ label $top .nl -text [mc " Name" ]
2619+ entry $top .name -width 20 -textvariable newviewname($n )
26262620 grid $top .nl $top .name -sticky w -pady 5
2627- checkbutton $top .perm -text [mc " Remember this view" ] -variable newviewperm( $n ) \
2628- -font uifont
2621+ checkbutton $top .perm -text [mc " Remember this view" ] \
2622+ -variable newviewperm( $n )
26292623 grid $top .perm - -pady 5 -sticky w
2630- message $top .al -aspect 1000 -font uifont \
2624+ message $top .al -aspect 1000 \
26312625 -text [mc " Commits to include (arguments to git rev-list):" ]
26322626 grid $top .al - -sticky w -pady 5
26332627 entry $top .args -width 50 -textvariable newviewargs($n ) \
2634- -background white -font uifont
2628+ -background white
26352629 grid $top .args - -sticky ew -padx 5
2636- message $top .l -aspect 1000 -font uifont \
2630+ message $top .l -aspect 1000 \
26372631 -text [mc " Enter files and directories to include, one per line:" ]
26382632 grid $top .l - -sticky w
26392633 text $top .t -width 40 -height 10 -background white -font uifont
@@ -2647,10 +2641,8 @@ proc vieweditor {top n title} {
26472641 }
26482642 grid $top .t - -sticky ew -padx 5
26492643 frame $top .buts
2650- button $top .buts.ok -text [mc " OK" ] -command [list newviewok $top $n ] \
2651- -font uifont
2652- button $top .buts.can -text [mc " Cancel" ] -command [list destroy $top ] \
2653- -font uifont
2644+ button $top .buts.ok -text [mc " OK" ] -command [list newviewok $top $n ]
2645+ button $top .buts.can -text [mc " Cancel" ] -command [list destroy $top ]
26542646 grid $top .buts.ok $top .buts.can
26552647 grid columnconfigure $top .buts 0 -weight 1 -uniform a
26562648 grid columnconfigure $top .buts 1 -weight 1 -uniform a
@@ -7226,15 +7218,14 @@ proc showrefs {} {
72267218 grid $top .list $top .ysb -sticky nsew
72277219 grid $top .xsb x -sticky ew
72287220 frame $top .f
7229- label $top .f.l -text " [ mc " Filter" ] : " -font uifont
7230- entry $top .f.e -width 20 -textvariable reflistfilter -font uifont
7221+ label $top .f.l -text " [ mc " Filter" ] : "
7222+ entry $top .f.e -width 20 -textvariable reflistfilter
72317223 set reflistfilter " *"
72327224 trace add variable reflistfilter write reflistfilter_change
72337225 pack $top .f.e -side right -fill x -expand 1
72347226 pack $top .f.l -side left
72357227 grid $top .f - -sticky ew -pady 2
7236- button $top .close -command [list destroy $top ] -text [mc " Close" ] \
7237- -font uifont
7228+ button $top .close -command [list destroy $top ] -text [mc " Close" ]
72387229 grid $top .close -
72397230 grid columnconfigure $top 0 -weight 1
72407231 grid rowconfigure $top 0 -weight 1
@@ -8546,7 +8537,7 @@ proc choosefont {font which} {
85468537 eval font config sample [font actual $font ]
85478538 toplevel $top
85488539 wm title $top [mc " Gitk font chooser" ]
8549- label $top .l -textvariable fontparam(which) -font uifont
8540+ label $top .l -textvariable fontparam(which)
85508541 pack $top .l -side top
85518542 set fontlist [lsort [font families]]
85528543 frame $top .f
@@ -8576,10 +8567,8 @@ proc choosefont {font which} {
85768567 bind $top .c <Configure> [list centertext $top .c]
85778568 pack $top .c -side top -fill x
85788569 frame $top .buts
8579- button $top .buts.ok -text [mc " OK" ] -command fontok -default active \
8580- -font uifont
8581- button $top .buts.can -text [mc " Cancel" ] -command fontcan -default normal \
8582- -font uifont
8570+ button $top .buts.ok -text [mc " OK" ] -command fontok -default active
8571+ button $top .buts.can -text [mc " Cancel" ] -command fontcan -default normal
85838572 grid $top .buts.ok $top .buts.can
85848573 grid columnconfigure $top .buts 0 -weight 1 -uniform a
85858574 grid columnconfigure $top .buts 1 -weight 1 -uniform a
@@ -8647,7 +8636,7 @@ proc doprefs {} {
86478636 global maxwidth maxgraphpct
86488637 global oldprefs prefstop showneartags showlocalchanges
86498638 global bgcolor fgcolor ctext diffcolors selectbgcolor
8650- global uifont tabstop limitdiffs
8639+ global tabstop limitdiffs
86518640
86528641 set top .gitkprefs
86538642 set prefstop $top
@@ -8662,7 +8651,6 @@ proc doprefs {} {
86628651 toplevel $top
86638652 wm title $top [mc " Gitk preferences" ]
86648653 label $top .ldisp -text [mc " Commit list display options" ]
8665- $top .ldisp configure -font uifont
86668654 grid $top .ldisp - -sticky w -pady 10
86678655 label $top .spacer -text " "
86688656 label $top .maxwidthl -text [mc " Maximum graph width (lines)" ] \
@@ -8680,7 +8668,6 @@ proc doprefs {} {
86808668 grid x $top .showlocal -sticky w
86818669
86828670 label $top .ddisp -text [mc " Diff display options" ]
8683- $top .ddisp configure -font uifont
86848671 grid $top .ddisp - -sticky w -pady 10
86858672 label $top .tabstopl -text [mc " Tab spacing" ] -font optionfont
86868673 spinbox $top .tabstop -from 1 -to 20 -width 4 -textvariable tabstop
@@ -8697,7 +8684,6 @@ proc doprefs {} {
86978684 grid x $top .ldiff -sticky w
86988685
86998686 label $top .cdisp -text [mc " Colors: press to choose" ]
8700- $top .cdisp configure -font uifont
87018687 grid $top .cdisp - -sticky w -pady 10
87028688 label $top .bg -padx 40 -relief sunk -background $bgcolor
87038689 button $top .bgbut -text [mc " Background" ] -font optionfont \
@@ -8729,17 +8715,14 @@ proc doprefs {} {
87298715 grid x $top .selbgbut $top .selbgsep -sticky w
87308716
87318717 label $top .cfont -text [mc " Fonts: press to choose" ]
8732- $top .cfont configure -font uifont
87338718 grid $top .cfont - -sticky w -pady 10
87348719 mkfontdisp mainfont $top [mc " Main font" ]
87358720 mkfontdisp textfont $top [mc " Diff display font" ]
87368721 mkfontdisp uifont $top [mc " User interface font" ]
87378722
87388723 frame $top .buts
87398724 button $top .buts.ok -text [mc " OK" ] -command prefsok -default active
8740- $top .buts.ok configure -font uifont
87418725 button $top .buts.can -text [mc " Cancel" ] -command prefscan -default normal
8742- $top .buts.can configure -font uifont
87438726 grid $top .buts.ok $top .buts.can
87448727 grid columnconfigure $top .buts 0 -weight 1 -uniform a
87458728 grid columnconfigure $top .buts 1 -weight 1 -uniform a
@@ -9215,6 +9198,8 @@ eval font create textfontbold [fontflags textfont 1]
92159198parsefont uifont $uifont
92169199eval font create uifont [fontflags uifont]
92179200
9201+ setoptions
9202+
92189203# check that we can find a .git directory somewhere...
92199204if {[catch {set gitdir [gitdir]}]} {
92209205 show_error {} . [mc " Cannot find a git repository here." ]
0 commit comments