Use monospace font for some numeric columns

This commit is contained in:
René Stadler 2007-11-14 22:51:47 +02:00 committed by Stefan Sauer
parent b1085b3b4d
commit 2511183d74

View file

@ -265,6 +265,8 @@ class SizedColumn (Column):
# Sync with gst-inspector? # Sync with gst-inspector?
class TextColumn (SizedColumn): class TextColumn (SizedColumn):
font_family = None
def __init__ (self): def __init__ (self):
Column.__init__ (self) Column.__init__ (self)
@ -273,6 +275,10 @@ class TextColumn (SizedColumn):
cell = gtk.CellRendererText () cell = gtk.CellRendererText ()
column.pack_start (cell) column.pack_start (cell)
if self.font_family:
cell.props.family = self.font_family
cell.props.family_set = True
if not self.get_modify_func: if not self.get_modify_func:
column.add_attribute (cell, "text", self.id) column.add_attribute (cell, "text", self.id)
else: else:
@ -315,6 +321,7 @@ class TimeColumn (TextColumn):
name = "time" name = "time"
label_header = _("Time") label_header = _("Time")
id = LazyLogModel.COL_TIME id = LazyLogModel.COL_TIME
font_family = "monospace"
@staticmethod @staticmethod
def get_modify_func (): def get_modify_func ():
@ -364,6 +371,7 @@ class PidColumn (TextColumn):
name = "pid" name = "pid"
label_header = _("PID") label_header = _("PID")
id = LazyLogModel.COL_PID id = LazyLogModel.COL_PID
font_family = "monospace"
@staticmethod @staticmethod
def get_modify_func (): def get_modify_func ():
@ -382,6 +390,7 @@ class ThreadColumn (TextColumn):
name = "thread" name = "thread"
label_header = _("Thread") label_header = _("Thread")
id = LazyLogModel.COL_THREAD id = LazyLogModel.COL_THREAD
font_family = "monospace"
@staticmethod @staticmethod
def get_modify_func (): def get_modify_func ():
@ -396,7 +405,7 @@ class ThreadColumn (TextColumn):
# TODO: Same as for TimeColumn. There is no guarantee that aaaaaaaa is # TODO: Same as for TimeColumn. There is no guarantee that aaaaaaaa is
# the widest string; use fixed font or come up with something better. # the widest string; use fixed font or come up with something better.
return [int ("aaaaaaaaa", 16)] return [int ("ffffff", 16)]
class CategoryColumn (TextColumn): class CategoryColumn (TextColumn):