diff options
| author | Shannon Barber <sbarber@dataspeedinc.com> | 2026-01-13 06:28:41 +0000 |
|---|---|---|
| committer | Johannes Sixt <j6t@kdbg.org> | 2026-01-14 09:50:13 +0100 |
| commit | bcb4fd1799485afbb2391aa312f4d947274bd7d4 (patch) | |
| tree | 97958f9ffbac781515f38170ba8b6e6555e5b1a0 | |
| parent | 776223c4d8482a29585266e189ea8f1933ac9652 (diff) | |
| download | git-bcb4fd1799485afbb2391aa312f4d947274bd7d4.tar.xz | |
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 <sgbarber@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
| -rwxr-xr-x | gitk | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -6831,16 +6831,18 @@ proc drawtags {id x xt y1} { } else { # draw a head or other ref if {[incr nheads -1] >= 0} { - set col $headbgcolor + set refoutlinecol $headoutlinecolor + set reffillcol $headbgcolor if {$tag eq $mainhead} { set font mainfontbold } } else { - set col "#ddddff" + set refoutlinecol black + set reffillcol "#ddddff" } set xl [expr {$xl - $delta/2}] $canv create polygon $x $yt $xr $yt $xr $yb $x $yb \ - -width 1 -outline black -fill $col -tags tag.$id + -width 1 -outline $refoutlinecol -fill $reffillcol -tags tag.$id if {[regexp {^(remotes/.*/|remotes/)} $tag match remoteprefix]} { set rwid [font measure mainfont $remoteprefix] set xi [expr {$x + 1}] @@ -6850,7 +6852,8 @@ proc drawtags {id x xt y1} { -width 0 -fill $remotebgcolor -tags tag.$id } } - set t [$canv create text $xl $y1 -anchor w -text $tag -fill $headfgcolor \ + set textfgcolor [expr {$ntags >= 0 ? $tagfgcolor : $headfgcolor}] + set t [$canv create text $xl $y1 -anchor w -text $tag -fill $textfgcolor \ -font $font -tags [list tag.$id text]] if {$ntags >= 0} { $canv bind $t <1> $tagclick |
