gitview: Use monospace font to draw the branch and tag name
authoraneesh.kumar@gmail.com <aneesh.kumar@gmail.com>
Tue, 21 Feb 2006 10:30:10 +0000 (16:00 +0530)
committerJunio C Hamano <junkio@cox.net>
Wed, 22 Feb 2006 02:38:11 +0000 (18:38 -0800)
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>
Signed-off-by: Junio C Hamano <junkio@cox.net>
contrib/gitview/gitview

index b75b39e5fc94bcf96e368ff20ac14e4afb90726f..5c338c02206869d4e6dadb2d15212532678c6f12 100755 (executable)
@@ -160,9 +160,9 @@ class CellRendererGraph(gtk.GenericCellRenderer):
                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
@@ -244,6 +244,8 @@ class CellRendererGraph(gtk.GenericCellRenderer):
                        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)
@@ -515,8 +517,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)