Skip to content

Commit ddbbd74

Browse files
committed
gitk: use config settings for head/tag colors
The drawtags procedure currently uses headfgcolor for all label text, ignoring the tagfgcolor setting. The call to create the outline polygon for (non-tag) heads currently has the color for headoutlinecolor hardcoded to black. This patch maintains the variables for the non-tag refs so that heads are colored differently from non-head (non-tag) refs. The outline and fill colors for the non-head refs remain hardcoded to the prior values, black & #ddddff. Signed-off-by: Shannon Barber <[email protected]>
1 parent d529f3a commit ddbbd74

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

gitk-git/gitk

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6831,16 +6831,18 @@ proc drawtags {id x xt y1} {
68316831
} else {
68326832
# draw a head or other ref
68336833
if {[incr nheads -1] >= 0} {
6834-
set col $headbgcolor
6834+
set refoutlinecol $headoutlinecolor
6835+
set reffillcol $headbgcolor
68356836
if {$tag eq $mainhead} {
68366837
set font mainfontbold
68376838
}
68386839
} else {
6839-
set col "#ddddff"
6840+
set refoutlinecol black
6841+
set reffillcol "#ddddff"
68406842
}
68416843
set xl [expr {$xl - $delta/2}]
68426844
$canv create polygon $x $yt $xr $yt $xr $yb $x $yb \
6843-
-width 1 -outline black -fill $col -tags tag.$id
6845+
-width 1 -outline $refoutlinecol -fill $reffillcol -tags tag.$id
68446846
if {[regexp {^(remotes/.*/|remotes/)} $tag match remoteprefix]} {
68456847
set rwid [font measure mainfont $remoteprefix]
68466848
set xi [expr {$x + 1}]
@@ -6850,7 +6852,8 @@ proc drawtags {id x xt y1} {
68506852
-width 0 -fill $remotebgcolor -tags tag.$id
68516853
}
68526854
}
6853-
set t [$canv create text $xl $y1 -anchor w -text $tag -fill $headfgcolor \
6855+
set textfgcolor [expr {$ntags >= 0 ? $tagfgcolor : $headfgcolor}]
6856+
set t [$canv create text $xl $y1 -anchor w -text $tag -fill $textfgcolor \
68546857
-font $font -tags [list tag.$id text]]
68556858
if {$ntags >= 0} {
68566859
$canv bind $t <1> $tagclick

0 commit comments

Comments
 (0)