git/list[1] front-page[2] threads[3] people[4] search[5] about
 

gitview: Use monospace font to draw the branch and tag name

From
Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Date
Feb 22, 2006, 16:06 UTC
Message-ID
<43FC8BF2.60205@gmail.com>

This patch address the below: Use monospace font to draw branch and tag name set the font size to 13. Make the graph column resizable. This helps to accommodate large tag names

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
---
 contrib/gitview/gitview |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
725c7d29cbe4efd0a7f7d9f218dc12e36f5920de
diff --git a/contrib/gitview/gitview b/contrib/gitview/gitview
index 5862fcc..0e52c78 100755
--- a/contrib/gitview/gitview
+++ b/contrib/gitview/gitview
@@ -174,9 +174,9 @@ class CellRendererGraph(gtk.GenericCellR
 		names_len = 0
 		if (len(names) != 0):
 			for item in names:
-				names_len += len(item)/3
+				names_len += len(item)
 
-		width = box_size * (cols + 1 + names_len )
+		width = box_size * (cols + 1 ) + names_len 
 		height = box_size
 
 		# FIXME I have no idea how to use cell_area properly
@@ -258,6 +258,8 @@ class CellRendererGraph(gtk.GenericCellR
 			for item in names:
 				name = name + item + " "
 
+			ctx.select_font_face("Monospace")
+			ctx.set_font_size(13)
 			ctx.text_path(name)
 
 		self.set_colour(ctx, colour, 0.0, 0.5)
@@ -537,8 +539,8 @@ class GitView:
 
 		cell = CellRendererGraph()
 		column = gtk.TreeViewColumn()
-		column.set_resizable(False)
-		column.pack_start(cell, expand=False)
+		column.set_resizable(True)
+		column.pack_start(cell, expand=True)
 		column.add_attribute(cell, "node", 1)
 		column.add_attribute(cell, "in-lines", 2)
 		column.add_attribute(cell, "out-lines", 3)
-- 
1.2.0-dirty
Next: Junio C Hamano
Message 1 of 5 in “gitview: Use monospace font to draw the branch and tag name”
  1. Aneesh Kumar K.VFeb 22, 2006
  2. Junio C HamanoFeb 24, 2006
  3. Aneesh KumarFeb 24, 2006
  4. Junio C HamanoFeb 25, 2006
  5. Aneesh KumarFeb 25, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.