@@ -11720,57 +11720,63 @@ proc prefspage_colors {notebook} {
11720
11720
grid $page .cdisp - -sticky w -pady 10
11721
11721
label $page .ui -padx 40 -relief sunk -background $uicolor
11722
11722
ttk::button $page .uibut -text [ mc " Interface" ] \
11723
- -command [ list choosecolor uicolor {} $page .ui [mc " interface" ] setui ]
11723
+ -command [ list choosecolor uicolor {} $page [mc " interface" ] ]
11724
11724
grid x $page .uibut $page .ui -sticky w
11725
11725
label $page .bg -padx 40 -relief sunk -background $bgcolor
11726
11726
ttk::button $page .bgbut -text [ mc " Background" ] \
11727
- -command [ list choosecolor bgcolor {} $page .bg [mc " background" ] setbg ]
11727
+ -command [ list choosecolor bgcolor {} $page [mc " background" ] ]
11728
11728
grid x $page .bgbut $page .bg -sticky w
11729
11729
label $page .fg -padx 40 -relief sunk -background $fgcolor
11730
11730
ttk::button $page .fgbut -text [ mc " Foreground" ] \
11731
- -command [ list choosecolor fgcolor {} $page .fg [mc " foreground" ] setfg ]
11731
+ -command [ list choosecolor fgcolor {} $page [mc " foreground" ] ]
11732
11732
grid x $page .fgbut $page .fg -sticky w
11733
11733
label $page .diffold -padx 40 -relief sunk -background [ lindex $diffcolors 0]
11734
11734
ttk::button $page .diffoldbut -text [ mc " Diff: old lines" ] \
11735
- -command [ list choosecolor diffcolors 0 $page .diffold [mc " diff old lines" ] \
11736
- [ list $ctext tag conf d0 -foreground] ]
11735
+ -command [ list choosecolor diffcolors 0 $page [mc " diff old lines" ] ]
11737
11736
grid x $page .diffoldbut $page .diffold -sticky w
11738
11737
label $page .diffoldbg -padx 40 -relief sunk -background [ lindex $diffbgcolors 0]
11739
11738
ttk::button $page .diffoldbgbut -text [ mc " Diff: old lines bg" ] \
11740
- -command [ list choosecolor diffbgcolors 0 $page .diffoldbg \
11741
- [mc " diff old lines bg" ] \
11742
- [ list $ctext tag conf d0 -background] ]
11739
+ -command [ list choosecolor diffbgcolors 0 $page [mc " diff old lines bg" ] ]
11743
11740
grid x $page .diffoldbgbut $page .diffoldbg -sticky w
11744
11741
label $page .diffnew -padx 40 -relief sunk -background [ lindex $diffcolors 1]
11745
11742
ttk::button $page .diffnewbut -text [ mc " Diff: new lines" ] \
11746
- -command [ list choosecolor diffcolors 1 $page .diffnew [mc " diff new lines" ] \
11747
- [ list $ctext tag conf dresult -foreground] ]
11743
+ -command [ list choosecolor diffcolors 1 $page [mc " diff new lines" ] ]
11748
11744
grid x $page .diffnewbut $page .diffnew -sticky w
11749
11745
label $page .diffnewbg -padx 40 -relief sunk -background [ lindex $diffbgcolors 1]
11750
11746
ttk::button $page .diffnewbgbut -text [ mc " Diff: new lines bg" ] \
11751
- -command [ list choosecolor diffbgcolors 1 $page .diffnewbg \
11752
- [mc " diff new lines bg" ] \
11753
- [ list $ctext tag conf dresult -background] ]
11747
+ -command [ list choosecolor diffbgcolors 1 $page [mc " diff new lines bg" ] ]
11754
11748
grid x $page .diffnewbgbut $page .diffnewbg -sticky w
11755
11749
label $page .hunksep -padx 40 -relief sunk -background [ lindex $diffcolors 2]
11756
11750
ttk::button $page .hunksepbut -text [ mc " Diff: hunk header" ] \
11757
- -command [ list choosecolor diffcolors 2 $page .hunksep \
11758
- [mc " diff hunk header" ] \
11759
- [ list $ctext tag conf hunksep -foreground] ]
11751
+ -command [ list choosecolor diffcolors 2 $page [mc " diff hunk header" ] ]
11760
11752
grid x $page .hunksepbut $page .hunksep -sticky w
11761
11753
label $page .markbgsep -padx 40 -relief sunk -background $markbgcolor
11762
11754
ttk::button $page .markbgbut -text [ mc " Marked line bg" ] \
11763
- -command [ list choosecolor markbgcolor {} $page .markbgsep \
11764
- [mc " marked line background" ] \
11765
- [ list $ctext tag conf omark -background] ]
11755
+ -command [ list choosecolor markbgcolor {} $page [mc " marked line background" ] ]
11766
11756
grid x $page .markbgbut $page .markbgsep -sticky w
11767
11757
label $page .selbgsep -padx 40 -relief sunk -background $selectbgcolor
11768
11758
ttk::button $page .selbgbut -text [ mc " Select bg" ] \
11769
- -command [ list choosecolor selectbgcolor {} $page .selbgsep [mc " background" ] setselbg ]
11759
+ -command [ list choosecolor selectbgcolor {} $page [mc " background" ] ]
11770
11760
grid x $page .selbgbut $page .selbgsep -sticky w
11771
11761
return $page
11772
11762
}
11773
11763
11764
+ proc prefspage_set_colorswatches {page} {
11765
+ global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
11766
+ global diffbgcolors
11767
+
11768
+ $page .ui configure -background $uicolor
11769
+ $page .bg configure -background $bgcolor
11770
+ $page .fg configure -background $fgcolor
11771
+ $page .diffold configure -background [ lindex $diffcolors 0]
11772
+ $page .diffoldbg configure -background [ lindex $diffbgcolors 0]
11773
+ $page .diffnew configure -background [ lindex $diffcolors 1]
11774
+ $page .diffnewbg configure -background [ lindex $diffbgcolors 1]
11775
+ $page .hunksep configure -background [ lindex $diffcolors 2]
11776
+ $page .markbgsep configure -background $markbgcolor
11777
+ $page .selbgsep configure -background $selectbgcolor
11778
+ }
11779
+
11774
11780
proc prefspage_fonts {notebook} {
11775
11781
set page [ create_prefs_page $notebook .fonts]
11776
11782
ttk::label $page .cfont -text [ mc " Fonts: press to choose" ] -font mainfontbold
@@ -11838,15 +11844,15 @@ proc choose_extdiff {} {
11838
11844
}
11839
11845
}
11840
11846
11841
- proc choosecolor {v vi w x cmd } {
11847
+ proc choosecolor {v vi prefspage x } {
11842
11848
global $v
11843
11849
11844
11850
set c [ tk_chooseColor -initialcolor [lindex [set $v ] $vi ] \
11845
11851
-title [ mc " Gitk: choose color for %s" $x ] ]
11846
11852
if {$c eq {}} return
11847
- $w conf -background $c
11848
11853
lset $v $vi $c
11849
- eval $cmd $c
11854
+ set_gui_colors
11855
+ prefspage_set_colorswatches $prefspage
11850
11856
}
11851
11857
11852
11858
proc setselbg {c} {
@@ -11899,6 +11905,22 @@ proc setfg {c} {
11899
11905
$canv itemconf markid -outline $c
11900
11906
}
11901
11907
11908
+ proc set_gui_colors {} {
11909
+ global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
11910
+ global diffbgcolors
11911
+
11912
+ setui $uicolor
11913
+ setbg $bgcolor
11914
+ setfg $fgcolor
11915
+ $ctext tag conf d0 -foreground [ lindex $diffcolors 0]
11916
+ $ctext tag conf d0 -background [ lindex $diffbgcolors 0]
11917
+ $ctext tag conf dresult -foreground [ lindex $diffcolors 1]
11918
+ $ctext tag conf dresult -background [ lindex $diffbgcolors 1]
11919
+ $ctext tag conf hunksep -foreground [ lindex $diffcolors 2]
11920
+ $ctext tag conf omark -background $markbgcolor
11921
+ setselbg $selectbgcolor
11922
+ }
11923
+
11902
11924
proc prefscan {} {
11903
11925
global oldprefs prefstop
11904
11926
global {*}$::config_variables
@@ -11909,6 +11931,7 @@ proc prefscan {} {
11909
11931
catch {destroy $prefstop }
11910
11932
unset prefstop
11911
11933
fontcan
11934
+ set_gui_colors
11912
11935
}
11913
11936
11914
11937
proc prefsok {} {
@@ -12624,8 +12647,6 @@ eval font create textfontbold [fontflags textfont 1]
12624
12647
parsefont uifont $uifont
12625
12648
eval font create uifont [ fontflags uifont]
12626
12649
12627
- setui $uicolor
12628
-
12629
12650
setoptions
12630
12651
12631
12652
# check that we can find a .git directory somewhere...
@@ -12814,6 +12835,8 @@ if {[tk windowingsystem] eq "win32"} {
12814
12835
focus -force .
12815
12836
}
12816
12837
12838
+ set_gui_colors
12839
+
12817
12840
getcommits {}
12818
12841
12819
12842
# Local variables:
0 commit comments