@@ -613,6 +613,19 @@ proc confirm_popup msg {
613
613
return $confirm_ok
614
614
}
615
615
616
+ proc setoptions {} {
617
+ option add *Panedwindow.showHandle 1 startupFile
618
+ option add *Panedwindow.sashRelief raised startupFile
619
+ option add *Button.font uifont startupFile
620
+ option add *Checkbutton.font uifont startupFile
621
+ option add *Radiobutton.font uifont startupFile
622
+ option add *Menu.font uifont startupFile
623
+ option add *Menubutton.font uifont startupFile
624
+ option add *Label.font uifont startupFile
625
+ option add *Message.font uifont startupFile
626
+ option add *Entry.font uifont startupFile
627
+ }
628
+
616
629
proc makewindow {} {
617
630
global canv canv2 canv3 linespc charspc ctext cflist
618
631
global tabstop
@@ -631,19 +644,16 @@ proc makewindow {} {
631
644
632
645
menu .bar
633
646
.bar add cascade -label [mc " File" ] -menu .bar.file
634
- .bar configure -font uifont
635
647
menu .bar.file
636
648
.bar.file add command -label [mc " Update" ] -command updatecommits
637
649
.bar.file add command -label [mc " Reread references" ] -command rereadrefs
638
650
.bar.file add command -label [mc " List references" ] -command showrefs
639
651
.bar.file add command -label [mc " Quit" ] -command doquit
640
- .bar.file configure -font uifont
641
652
menu .bar.edit
642
653
.bar add cascade -label [mc " Edit" ] -menu .bar.edit
643
654
.bar.edit add command -label [mc " Preferences" ] -command doprefs
644
- .bar.edit configure -font uifont
645
655
646
- menu .bar.view -font uifont
656
+ menu .bar.view
647
657
.bar add cascade -label [mc " View" ] -menu .bar.view
648
658
.bar.view add command -label [mc " New view..." ] -command {newview 0}
649
659
.bar.view add command -label [mc " Edit view..." ] -command editview \
@@ -657,7 +667,7 @@ proc makewindow {} {
657
667
.bar add cascade -label [mc " Help" ] -menu .bar.help
658
668
.bar.help add command -label [mc " About gitk" ] -command about
659
669
.bar.help add command -label [mc " Key bindings" ] -command keys
660
- .bar.help configure -font uifont
670
+ .bar.help configure
661
671
. configure -menu .bar
662
672
663
673
# the gui has upper and lower half, parts of a paned window.
@@ -714,7 +724,7 @@ proc makewindow {} {
714
724
set entries $sha1entry
715
725
set sha1but .tf.bar.sha1label
716
726
button $sha1but -text [mc " SHA1 ID: " ] -state disabled -relief flat \
717
- -command gotocommit -width 8 -font uifont
727
+ -command gotocommit -width 8
718
728
$sha1but conf -disabledforeground [$sha1but cget -foreground]
719
729
pack .tf.bar.sha1label -side left
720
730
entry $sha1entry -width 40 -font textfont -textvariable sha1string
@@ -746,7 +756,7 @@ proc makewindow {} {
746
756
747
757
# Status label and progress bar
748
758
set statusw .tf.bar.status
749
- label $statusw -width 15 -relief sunken -font uifont
759
+ label $statusw -width 15 -relief sunken
750
760
pack $statusw -side left -padx 5
751
761
set h [expr {[font metrics uifont -linespace] + 2}]
752
762
set progresscanv .tf.bar.progress
@@ -763,10 +773,10 @@ proc makewindow {} {
763
773
set progupdatepending 0
764
774
765
775
# build up the bottom bar of upper window
766
- label .tf.lbar.flabel -text " [ mc " Find" ] " -font uifont
767
- button .tf.lbar.fnext -text [mc " next" ] -command {dofind 1 1} -font uifont
768
- button .tf.lbar.fprev -text [mc " prev" ] -command {dofind -1 1} -font uifont
769
- label .tf.lbar.flab2 -text " [ mc " commit" ] " -font uifont
776
+ label .tf.lbar.flabel -text " [ mc " Find" ] "
777
+ button .tf.lbar.fnext -text [mc " next" ] -command {dofind 1 1}
778
+ button .tf.lbar.fprev -text [mc " prev" ] -command {dofind -1 1}
779
+ label .tf.lbar.flab2 -text " [ mc " commit" ] "
770
780
pack .tf.lbar.flabel .tf.lbar.fnext .tf.lbar.fprev .tf.lbar.flab2 \
771
781
-side left -fill y
772
782
set gdttype [mc " containing:" ]
@@ -775,8 +785,6 @@ proc makewindow {} {
775
785
[mc " touching paths:" ] \
776
786
[mc " adding/removing string:" ]]
777
787
trace add variable gdttype write gdttype_change
778
- $gm conf -font uifont
779
- .tf.lbar.gdttype conf -font uifont
780
788
pack .tf.lbar.gdttype -side left -fill y
781
789
782
790
set findstring {}
@@ -788,14 +796,10 @@ proc makewindow {} {
788
796
set findtypemenu [tk_optionMenu .tf.lbar.findtype \
789
797
findtype [mc " Exact" ] [mc " IgnCase" ] [mc " Regexp" ]]
790
798
trace add variable findtype write findcom_change
791
- .tf.lbar.findtype configure -font uifont
792
- .tf.lbar.findtype.menu configure -font uifont
793
799
set findloc [mc " All fields" ]
794
800
tk_optionMenu .tf.lbar.findloc findloc [mc " All fields" ] [mc " Headline" ] \
795
801
[mc " Comments" ] [mc " Author" ] [mc " Committer" ]
796
802
trace add variable findloc write find_change
797
- .tf.lbar.findloc configure -font uifont
798
- .tf.lbar.findloc.menu configure -font uifont
799
803
pack .tf.lbar.findloc -side right
800
804
pack .tf.lbar.findtype -side right
801
805
pack $fstring -side left -expand 1 -fill x
@@ -822,22 +826,20 @@ proc makewindow {} {
822
826
frame .bleft.top
823
827
frame .bleft.mid
824
828
825
- button .bleft.top.search -text [mc " Search" ] -command dosearch \
826
- -font uifont
829
+ button .bleft.top.search -text [mc " Search" ] -command dosearch
827
830
pack .bleft.top.search -side left -padx 5
828
831
set sstring .bleft.top.sstring
829
832
entry $sstring -width 20 -font textfont -textvariable searchstring
830
833
lappend entries $sstring
831
834
trace add variable searchstring write incrsearch
832
835
pack $sstring -side left -expand 1 -fill x
833
- radiobutton .bleft.mid.diff -text [mc " Diff" ] -font uifont \
836
+ radiobutton .bleft.mid.diff -text [mc " Diff" ] \
834
837
-command changediffdisp -variable diffelide -value {0 0}
835
- radiobutton .bleft.mid.old -text [mc " Old version" ] -font uifont \
838
+ radiobutton .bleft.mid.old -text [mc " Old version" ] \
836
839
-command changediffdisp -variable diffelide -value {0 1}
837
- radiobutton .bleft.mid.new -text [mc " New version" ] -font uifont \
840
+ radiobutton .bleft.mid.new -text [mc " New version" ] \
838
841
-command changediffdisp -variable diffelide -value {1 0}
839
- label .bleft.mid.labeldiffcontext -text " [ mc " Lines of context" ] : " \
840
- -font uifont
842
+ label .bleft.mid.labeldiffcontext -text " [ mc " Lines of context" ] : "
841
843
pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left
842
844
spinbox .bleft.mid.diffcontext -width 5 -font textfont \
843
845
-from 1 -increment 1 -to 10000000 \
@@ -897,10 +899,8 @@ proc makewindow {} {
897
899
frame .bright.mode
898
900
radiobutton .bright.mode.patch -text [mc " Patch" ] \
899
901
-command reselectline -variable cmitmode -value " patch"
900
- .bright.mode.patch configure -font uifont
901
902
radiobutton .bright.mode.tree -text [mc " Tree" ] \
902
903
-command reselectline -variable cmitmode -value " tree"
903
- .bright.mode.tree configure -font uifont
904
904
grid .bright.mode.patch .bright.mode.tree -sticky ew
905
905
pack .bright.mode -side top -fill x
906
906
set cflist .bright.cfiles
@@ -1286,17 +1286,14 @@ Copyright © 2005-2006 Paul Mackerras
1286
1286
Use and redistribute under the terms of the GNU General Public License" ] \
1287
1287
-justify center -aspect 400 -border 2 -bg white -relief groove
1288
1288
pack $w .m -side top -fill x -padx 2 -pady 2
1289
- $w .m configure -font uifont
1290
1289
button $w .ok -text [mc " Close" ] -command " destroy $w " -default active
1291
1290
pack $w .ok -side bottom
1292
- $w .ok configure -font uifont
1293
1291
bind $w <Visibility> " focus $w .ok"
1294
1292
bind $w <Key-Escape> " destroy $w "
1295
1293
bind $w <Key-Return> " destroy $w "
1296
1294
}
1297
1295
1298
1296
proc keys {} {
1299
- global uifont
1300
1297
set w .keys
1301
1298
if {[winfo exists $w ]} {
1302
1299
raise $w
@@ -1350,10 +1347,8 @@ f Scroll diff view to next file
1350
1347
" ] \
1351
1348
-justify left -bg white -border 2 -relief groove
1352
1349
pack $w .m -side top -fill both -padx 2 -pady 2
1353
- $w .m configure -font uifont
1354
1350
button $w .ok -text [mc " Close" ] -command " destroy $w " -default active
1355
1351
pack $w .ok -side bottom
1356
- $w .ok configure -font uifont
1357
1352
bind $w <Visibility> " focus $w .ok"
1358
1353
bind $w <Key-Escape> " destroy $w "
1359
1354
bind $w <Key-Return> " destroy $w "
@@ -1848,7 +1843,7 @@ proc shellsplit {str} {
1848
1843
# Code to implement multiple views
1849
1844
1850
1845
proc newview {ishighlight} {
1851
- global nextviewnum newviewname newviewperm uifont newishighlight
1846
+ global nextviewnum newviewname newviewperm newishighlight
1852
1847
global newviewargs revtreeargs
1853
1848
1854
1849
set newishighlight $ishighlight
@@ -1881,23 +1876,22 @@ proc editview {} {
1881
1876
1882
1877
proc vieweditor {top n title} {
1883
1878
global newviewname newviewperm viewfiles
1884
- global uifont
1885
1879
1886
1880
toplevel $top
1887
1881
wm title $top $title
1888
- label $top .nl -text [mc " Name" ] -font uifont
1889
- entry $top .name -width 20 -textvariable newviewname($n ) -font uifont
1882
+ label $top .nl -text [mc " Name" ]
1883
+ entry $top .name -width 20 -textvariable newviewname($n )
1890
1884
grid $top .nl $top .name -sticky w -pady 5
1891
- checkbutton $top .perm -text [mc " Remember this view" ] -variable newviewperm( $n ) \
1892
- -font uifont
1885
+ checkbutton $top .perm -text [mc " Remember this view" ] \
1886
+ -variable newviewperm( $n )
1893
1887
grid $top .perm - -pady 5 -sticky w
1894
- message $top .al -aspect 1000 -font uifont \
1888
+ message $top .al -aspect 1000 \
1895
1889
-text [mc " Commits to include (arguments to git rev-list):" ]
1896
1890
grid $top .al - -sticky w -pady 5
1897
1891
entry $top .args -width 50 -textvariable newviewargs($n ) \
1898
- -background white -font uifont
1892
+ -background white
1899
1893
grid $top .args - -sticky ew -padx 5
1900
- message $top .l -aspect 1000 -font uifont \
1894
+ message $top .l -aspect 1000 \
1901
1895
-text [mc " Enter files and directories to include, one per line:" ]
1902
1896
grid $top .l - -sticky w
1903
1897
text $top .t -width 40 -height 10 -background white -font uifont
@@ -1911,10 +1905,8 @@ proc vieweditor {top n title} {
1911
1905
}
1912
1906
grid $top .t - -sticky ew -padx 5
1913
1907
frame $top .buts
1914
- button $top .buts.ok -text [mc " OK" ] -command [list newviewok $top $n ] \
1915
- -font uifont
1916
- button $top .buts.can -text [mc " Cancel" ] -command [list destroy $top ] \
1917
- -font uifont
1908
+ button $top .buts.ok -text [mc " OK" ] -command [list newviewok $top $n ]
1909
+ button $top .buts.can -text [mc " Cancel" ] -command [list destroy $top ]
1918
1910
grid $top .buts.ok $top .buts.can
1919
1911
grid columnconfigure $top .buts 0 -weight 1 -uniform a
1920
1912
grid columnconfigure $top .buts 1 -weight 1 -uniform a
@@ -6522,15 +6514,14 @@ proc showrefs {} {
6522
6514
grid $top .list $top .ysb -sticky nsew
6523
6515
grid $top .xsb x -sticky ew
6524
6516
frame $top .f
6525
- label $top .f.l -text " [ mc " Filter" ] : " -font uifont
6526
- entry $top .f.e -width 20 -textvariable reflistfilter -font uifont
6517
+ label $top .f.l -text " [ mc " Filter" ] : "
6518
+ entry $top .f.e -width 20 -textvariable reflistfilter
6527
6519
set reflistfilter " *"
6528
6520
trace add variable reflistfilter write reflistfilter_change
6529
6521
pack $top .f.e -side right -fill x -expand 1
6530
6522
pack $top .f.l -side left
6531
6523
grid $top .f - -sticky ew -pady 2
6532
- button $top .close -command [list destroy $top ] -text [mc " Close" ] \
6533
- -font uifont
6524
+ button $top .close -command [list destroy $top ] -text [mc " Close" ]
6534
6525
grid $top .close -
6535
6526
grid columnconfigure $top 0 -weight 1
6536
6527
grid rowconfigure $top 0 -weight 1
@@ -7842,7 +7833,7 @@ proc choosefont {font which} {
7842
7833
eval font config sample [font actual $font ]
7843
7834
toplevel $top
7844
7835
wm title $top [mc " Gitk font chooser" ]
7845
- label $top .l -textvariable fontparam(which) -font uifont
7836
+ label $top .l -textvariable fontparam(which)
7846
7837
pack $top .l -side top
7847
7838
set fontlist [lsort [font families]]
7848
7839
frame $top .f
@@ -7872,10 +7863,8 @@ proc choosefont {font which} {
7872
7863
bind $top .c <Configure> [list centertext $top .c]
7873
7864
pack $top .c -side top -fill x
7874
7865
frame $top .buts
7875
- button $top .buts.ok -text [mc " OK" ] -command fontok -default active \
7876
- -font uifont
7877
- button $top .buts.can -text [mc " Cancel" ] -command fontcan -default normal \
7878
- -font uifont
7866
+ button $top .buts.ok -text [mc " OK" ] -command fontok -default active
7867
+ button $top .buts.can -text [mc " Cancel" ] -command fontcan -default normal
7879
7868
grid $top .buts.ok $top .buts.can
7880
7869
grid columnconfigure $top .buts 0 -weight 1 -uniform a
7881
7870
grid columnconfigure $top .buts 1 -weight 1 -uniform a
@@ -7943,7 +7932,7 @@ proc doprefs {} {
7943
7932
global maxwidth maxgraphpct
7944
7933
global oldprefs prefstop showneartags showlocalchanges
7945
7934
global bgcolor fgcolor ctext diffcolors selectbgcolor
7946
- global uifont tabstop limitdiffs
7935
+ global tabstop limitdiffs
7947
7936
7948
7937
set top .gitkprefs
7949
7938
set prefstop $top
@@ -7958,7 +7947,6 @@ proc doprefs {} {
7958
7947
toplevel $top
7959
7948
wm title $top [mc " Gitk preferences" ]
7960
7949
label $top .ldisp -text [mc " Commit list display options" ]
7961
- $top .ldisp configure -font uifont
7962
7950
grid $top .ldisp - -sticky w -pady 10
7963
7951
label $top .spacer -text " "
7964
7952
label $top .maxwidthl -text [mc " Maximum graph width (lines)" ] \
@@ -7976,7 +7964,6 @@ proc doprefs {} {
7976
7964
grid x $top .showlocal -sticky w
7977
7965
7978
7966
label $top .ddisp -text [mc " Diff display options" ]
7979
- $top .ddisp configure -font uifont
7980
7967
grid $top .ddisp - -sticky w -pady 10
7981
7968
label $top .tabstopl -text [mc " Tab spacing" ] -font optionfont
7982
7969
spinbox $top .tabstop -from 1 -to 20 -width 4 -textvariable tabstop
@@ -7993,7 +7980,6 @@ proc doprefs {} {
7993
7980
grid x $top .ldiff -sticky w
7994
7981
7995
7982
label $top .cdisp -text [mc " Colors: press to choose" ]
7996
- $top .cdisp configure -font uifont
7997
7983
grid $top .cdisp - -sticky w -pady 10
7998
7984
label $top .bg -padx 40 -relief sunk -background $bgcolor
7999
7985
button $top .bgbut -text [mc " Background" ] -font optionfont \
@@ -8025,17 +8011,14 @@ proc doprefs {} {
8025
8011
grid x $top .selbgbut $top .selbgsep -sticky w
8026
8012
8027
8013
label $top .cfont -text [mc " Fonts: press to choose" ]
8028
- $top .cfont configure -font uifont
8029
8014
grid $top .cfont - -sticky w -pady 10
8030
8015
mkfontdisp mainfont $top [mc " Main font" ]
8031
8016
mkfontdisp textfont $top [mc " Diff display font" ]
8032
8017
mkfontdisp uifont $top [mc " User interface font" ]
8033
8018
8034
8019
frame $top .buts
8035
8020
button $top .buts.ok -text [mc " OK" ] -command prefsok -default active
8036
- $top .buts.ok configure -font uifont
8037
8021
button $top .buts.can -text [mc " Cancel" ] -command prefscan -default normal
8038
- $top .buts.can configure -font uifont
8039
8022
grid $top .buts.ok $top .buts.can
8040
8023
grid columnconfigure $top .buts 0 -weight 1 -uniform a
8041
8024
grid columnconfigure $top .buts 1 -weight 1 -uniform a
@@ -8511,6 +8494,8 @@ eval font create textfontbold [fontflags textfont 1]
8511
8494
parsefont uifont $uifont
8512
8495
eval font create uifont [fontflags uifont]
8513
8496
8497
+ setoptions
8498
+
8514
8499
# check that we can find a .git directory somewhere...
8515
8500
if {[catch {set gitdir [gitdir]}]} {
8516
8501
show_error {} . [mc " Cannot find a git repository here." ]
0 commit comments