threads / patch / 2030

patch: gitk: different shape for other refs

Subject: [PATCH]: gitk: different shape for other refs

## tl;dr

One message between Oct 6, 2005 and Oct 6, 2005. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Pavel Roskin· Oct 6, 2005, 01:44 UTC · lore
Hello!

It's not unfriendly to distinguish heads and other refs only by color. Not everybody can distinguish green and blue. This patch changes the shape used for other refs to "tabs" with five corners.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Show changes to gitk +8 −6
diff --git a/gitk b/gitk
--- a/gitk
+++ b/gitk
@@ -939,15 +939,17 @@ proc drawtags {id x xt y1} {
 	    $canv bind $t <1> [list showtag $tag 1]
 	    set rowtextx($idline($id)) [expr {$xr + $linespc}]
 	} else {
-	    # draw a head or other ref
 	    if {[incr nheads -1] >= 0} {
-		set col green
+		# draw a head
+		set xl [expr $xl - $delta/2]
+		$canv create polygon $x $yt $xr $yt $xr $yb $x $yb \
+		    -width 1 -outline black -fill green -tags tag.$id
 	    } else {
-		set col "#ddddff"
+		# draw other ref
+		$canv create polygon $x [expr $yt + $delta] $xl $yt \
+		    $xr $yt $xr $yb $x $yb \
+		    -width 1 -outline black -fill "#ddddff" -tags tag.$id
 	    }
-	    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
 	}
 	set t [$canv create text $xl $y1 -anchor w -text $tag \
 		   -font $mainfont -tags tag.$id]
-- 
Regards,
Pavel Roskin

← back to recent threads