@@ -402,7 +402,7 @@ proc makewindow {} {
402
402
global rowctxmenu mergemax wrapcomment
403
403
global highlight_files gdttype
404
404
global searchstring sstring
405
- global bgcolor fgcolor bglist fglist diffcolors
405
+ global bgcolor fgcolor bglist fglist diffcolors selectbgcolor
406
406
global headctxmenu
407
407
408
408
menu .bar
@@ -457,15 +457,18 @@ proc makewindow {} {
457
457
set cscroll .tf.histframe.csb
458
458
set canv .tf.histframe.pwclist.canv
459
459
canvas $canv \
460
+ -selectbackground $selectbgcolor \
460
461
-background $bgcolor -bd 0 \
461
462
-yscrollincr $linespc -yscrollcommand " scrollcanv $cscroll "
462
463
.tf.histframe.pwclist add $canv
463
464
set canv2 .tf.histframe.pwclist.canv2
464
465
canvas $canv2 \
466
+ -selectbackground $selectbgcolor \
465
467
-background $bgcolor -bd 0 -yscrollincr $linespc
466
468
.tf.histframe.pwclist add $canv2
467
469
set canv3 .tf.histframe.pwclist.canv3
468
470
canvas $canv3 \
471
+ -selectbackground $selectbgcolor \
469
472
-background $bgcolor -bd 0 -yscrollincr $linespc
470
473
.tf.histframe.pwclist add $canv3
471
474
eval .tf.histframe.pwclist sash place 0 $geometry(pwsash0)
@@ -666,6 +669,7 @@ proc makewindow {} {
666
669
set cflist .bright.cfiles
667
670
set indent [font measure $mainfont " nn" ]
668
671
text $cflist \
672
+ -selectbackground $selectbgcolor \
669
673
-background $bgcolor -foreground $fgcolor \
670
674
-font $mainfont \
671
675
-tabs [list $indent [expr {2 * $indent }]] \
@@ -825,7 +829,7 @@ proc savestuff {w} {
825
829
global maxwidth showneartags
826
830
global viewname viewfiles viewargs viewperm nextviewnum
827
831
global cmitmode wrapcomment
828
- global colors bgcolor fgcolor diffcolors
832
+ global colors bgcolor fgcolor diffcolors selectbgcolor
829
833
830
834
if {$stuffsaved } return
831
835
if {![winfo viewable .]} return
@@ -844,6 +848,7 @@ proc savestuff {w} {
844
848
puts $f [list set fgcolor $fgcolor ]
845
849
puts $f [list set colors $colors ]
846
850
puts $f [list set diffcolors $diffcolors ]
851
+ puts $f [list set selectbgcolor $selectbgcolor ]
847
852
848
853
puts $f " set geometry(main) [ wm geometry .] "
849
854
puts $f " set geometry(topwidth) [ winfo width .tf] "
@@ -5845,7 +5850,7 @@ proc doquit {} {
5845
5850
proc doprefs {} {
5846
5851
global maxwidth maxgraphpct diffopts
5847
5852
global oldprefs prefstop showneartags
5848
- global bgcolor fgcolor ctext diffcolors
5853
+ global bgcolor fgcolor ctext diffcolors selectbgcolor
5849
5854
global uifont
5850
5855
5851
5856
set top .gitkprefs
@@ -5912,6 +5917,10 @@ proc doprefs {} {
5912
5917
" diff hunk header" \
5913
5918
[list $ctext tag conf hunksep -foreground]]
5914
5919
grid x $top .hunksepbut $top .hunksep -sticky w
5920
+ label $top .selbgsep -padx 40 -relief sunk -background $selectbgcolor
5921
+ button $top .selbgbut -text " Select bg" -font optionfont \
5922
+ -command [list choosecolor selectbgcolor 0 $top .bg background setselbg]
5923
+ grid x $top .selbgbut $top .selbgsep -sticky w
5915
5924
5916
5925
frame $top .buts
5917
5926
button $top .buts.ok -text " OK" -command prefsok -default active
@@ -5936,6 +5945,16 @@ proc choosecolor {v vi w x cmd} {
5936
5945
eval $cmd $c
5937
5946
}
5938
5947
5948
+ proc setselbg {c} {
5949
+ global bglist cflist
5950
+ foreach w $bglist {
5951
+ $w configure -selectbackground $c
5952
+ }
5953
+ $cflist tag configure highlight \
5954
+ -background [$cflist cget -selectbackground]
5955
+ allcanvs itemconf secsel -fill $c
5956
+ }
5957
+
5939
5958
proc setbg {c} {
5940
5959
global bglist
5941
5960
@@ -6292,6 +6311,7 @@ set colors {green red blue magenta darkgrey brown orange}
6292
6311
set bgcolor white
6293
6312
set fgcolor black
6294
6313
set diffcolors {red " #00a000" blue}
6314
+ set selectbgcolor gray85
6295
6315
6296
6316
catch {source ~/.gitk}
6297
6317
0 commit comments