@@ -11660,53 +11660,43 @@ proc prefspage_colors {notebook} {
11660
11660
grid $page .cdisp - -sticky w -pady 10
11661
11661
label $page .ui -padx 40 -relief sunk -background $uicolor
11662
11662
ttk::button $page .uibut -text [ mc " Interface" ] \
11663
- -command [ list choosecolor uicolor {} $page [mc " interface" ] setui ]
11663
+ -command [ list choosecolor uicolor {} $page [mc " interface" ] ]
11664
11664
grid x $page .uibut $page .ui -sticky w
11665
11665
label $page .bg -padx 40 -relief sunk -background $bgcolor
11666
11666
ttk::button $page .bgbut -text [ mc " Background" ] \
11667
- -command [ list choosecolor bgcolor {} $page [mc " background" ] setbg ]
11667
+ -command [ list choosecolor bgcolor {} $page [mc " background" ] ]
11668
11668
grid x $page .bgbut $page .bg -sticky w
11669
11669
label $page .fg -padx 40 -relief sunk -background $fgcolor
11670
11670
ttk::button $page .fgbut -text [ mc " Foreground" ] \
11671
- -command [ list choosecolor fgcolor {} $page [mc " foreground" ] setfg ]
11671
+ -command [ list choosecolor fgcolor {} $page [mc " foreground" ] ]
11672
11672
grid x $page .fgbut $page .fg -sticky w
11673
11673
label $page .diffold -padx 40 -relief sunk -background [ lindex $diffcolors 0]
11674
11674
ttk::button $page .diffoldbut -text [ mc " Diff: old lines" ] \
11675
- -command [ list choosecolor diffcolors 0 $page [mc " diff old lines" ] \
11676
- [ list $ctext tag conf d0 -foreground] ]
11675
+ -command [ list choosecolor diffcolors 0 $page [mc " diff old lines" ] ]
11677
11676
grid x $page .diffoldbut $page .diffold -sticky w
11678
11677
label $page .diffoldbg -padx 40 -relief sunk -background [ lindex $diffbgcolors 0]
11679
11678
ttk::button $page .diffoldbgbut -text [ mc " Diff: old lines bg" ] \
11680
- -command [ list choosecolor diffbgcolors 0 $page \
11681
- [mc " diff old lines bg" ] \
11682
- [ list $ctext tag conf d0 -background] ]
11679
+ -command [ list choosecolor diffbgcolors 0 $page [mc " diff old lines bg" ] ]
11683
11680
grid x $page .diffoldbgbut $page .diffoldbg -sticky w
11684
11681
label $page .diffnew -padx 40 -relief sunk -background [ lindex $diffcolors 1]
11685
11682
ttk::button $page .diffnewbut -text [ mc " Diff: new lines" ] \
11686
- -command [ list choosecolor diffcolors 1 $page [mc " diff new lines" ] \
11687
- [ list $ctext tag conf dresult -foreground] ]
11683
+ -command [ list choosecolor diffcolors 1 $page [mc " diff new lines" ] ]
11688
11684
grid x $page .diffnewbut $page .diffnew -sticky w
11689
11685
label $page .diffnewbg -padx 40 -relief sunk -background [ lindex $diffbgcolors 1]
11690
11686
ttk::button $page .diffnewbgbut -text [ mc " Diff: new lines bg" ] \
11691
- -command [ list choosecolor diffbgcolors 1 $page \
11692
- [mc " diff new lines bg" ] \
11693
- [ list $ctext tag conf dresult -background] ]
11687
+ -command [ list choosecolor diffbgcolors 1 $page [mc " diff new lines bg" ] ]
11694
11688
grid x $page .diffnewbgbut $page .diffnewbg -sticky w
11695
11689
label $page .hunksep -padx 40 -relief sunk -background [ lindex $diffcolors 2]
11696
11690
ttk::button $page .hunksepbut -text [ mc " Diff: hunk header" ] \
11697
- -command [ list choosecolor diffcolors 2 $page \
11698
- [mc " diff hunk header" ] \
11699
- [ list $ctext tag conf hunksep -foreground] ]
11691
+ -command [ list choosecolor diffcolors 2 $page [mc " diff hunk header" ] ]
11700
11692
grid x $page .hunksepbut $page .hunksep -sticky w
11701
11693
label $page .markbgsep -padx 40 -relief sunk -background $markbgcolor
11702
11694
ttk::button $page .markbgbut -text [ mc " Marked line bg" ] \
11703
- -command [ list choosecolor markbgcolor {} $page \
11704
- [mc " marked line background" ] \
11705
- [ list $ctext tag conf omark -background] ]
11695
+ -command [ list choosecolor markbgcolor {} $page [mc " marked line background" ] ]
11706
11696
grid x $page .markbgbut $page .markbgsep -sticky w
11707
11697
label $page .selbgsep -padx 40 -relief sunk -background $selectbgcolor
11708
11698
ttk::button $page .selbgbut -text [ mc " Select bg" ] \
11709
- -command [ list choosecolor selectbgcolor {} $page [mc " background" ] setselbg ]
11699
+ -command [ list choosecolor selectbgcolor {} $page [mc " background" ] ]
11710
11700
grid x $page .selbgbut $page .selbgsep -sticky w
11711
11701
return $page
11712
11702
}
@@ -11794,14 +11784,14 @@ proc choose_extdiff {} {
11794
11784
}
11795
11785
}
11796
11786
11797
- proc choosecolor {v vi prefspage x cmd } {
11787
+ proc choosecolor {v vi prefspage x} {
11798
11788
global $v
11799
11789
11800
11790
set c [ tk_chooseColor -initialcolor [lindex [set $v ] $vi ] \
11801
11791
-title [ mc " Gitk: choose color for %s" $x ] ]
11802
11792
if {$c eq {}} return
11803
11793
lset $v $vi $c
11804
- eval $cmd $c
11794
+ set_gui_colors
11805
11795
prefspage_set_colorswatches $prefspage
11806
11796
}
11807
11797
@@ -11855,6 +11845,22 @@ proc setfg {c} {
11855
11845
$canv itemconf markid -outline $c
11856
11846
}
11857
11847
11848
+ proc set_gui_colors {} {
11849
+ global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
11850
+ global diffbgcolors
11851
+
11852
+ setui $uicolor
11853
+ setbg $bgcolor
11854
+ setfg $fgcolor
11855
+ $ctext tag conf d0 -foreground [ lindex $diffcolors 0]
11856
+ $ctext tag conf d0 -background [ lindex $diffbgcolors 0]
11857
+ $ctext tag conf dresult -foreground [ lindex $diffcolors 1]
11858
+ $ctext tag conf dresult -background [ lindex $diffbgcolors 1]
11859
+ $ctext tag conf hunksep -foreground [ lindex $diffcolors 2]
11860
+ $ctext tag conf omark -background $markbgcolor
11861
+ setselbg $selectbgcolor
11862
+ }
11863
+
11858
11864
proc prefscan {} {
11859
11865
global oldprefs prefstop
11860
11866
global {*}$::config_variables
@@ -11865,6 +11871,7 @@ proc prefscan {} {
11865
11871
catch {destroy $prefstop }
11866
11872
unset prefstop
11867
11873
fontcan
11874
+ set_gui_colors
11868
11875
}
11869
11876
11870
11877
proc prefsok {} {
@@ -12567,8 +12574,6 @@ eval font create textfontbold [fontflags textfont 1]
12567
12574
parsefont uifont $uifont
12568
12575
eval font create uifont [ fontflags uifont]
12569
12576
12570
- setui $uicolor
12571
-
12572
12577
setoptions
12573
12578
12574
12579
# check that we can find a .git directory somewhere...
@@ -12757,6 +12762,8 @@ if {[tk windowingsystem] eq "win32"} {
12757
12762
focus -force .
12758
12763
}
12759
12764
12765
+ set_gui_colors
12766
+
12760
12767
getcommits {}
12761
12768
12762
12769
# Local variables:
0 commit comments