gitview: Use monospace font to draw the branch and tag name
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>
aneesh.kumar@gmail.com committed
Feb 21, 2006 at 16:00 UTC
d800795613a710fb18353af53730e75185861f41
1 file changed
+6
-4
contrib/gitview/gitview
+6
-4
@@ -160,9 +160,9 @@ class CellRendererGraph(gtk.GenericCellRenderer):
160
names_len = 0
161
if (len(names) != 0):
162
for item in names:
163
- names_len += len(item)/3
163
+ names_len += len(item)
164
165
- width = box_size * (cols + 1 + names_len )
165
+ width = box_size * (cols + 1 ) + names_len
166
height = box_size
167
168
# FIXME I have no idea how to use cell_area properly
@@ -244,6 +244,8 @@ class CellRendererGraph(gtk.GenericCellRenderer):
244
for item in names:
245
name = name + item + " "
246
247
+ ctx.select_font_face("Monospace")
248
+ ctx.set_font_size(13)
249
ctx.text_path(name)
250
251
self.set_colour(ctx, colour, 0.0, 0.5)
@@ -515,8 +517,8 @@ class GitView:
517
518
cell = CellRendererGraph()
519
column = gtk.TreeViewColumn()
518
- column.set_resizable(False)
519
- column.pack_start(cell, expand=False)
520
+ column.set_resizable(True)
521
+ column.pack_start(cell, expand=True)
522
column.add_attribute(cell, "node", 1)
523
column.add_attribute(cell, "in-lines", 2)
524
column.add_attribute(cell, "out-lines", 3)