From 6b31f572574dde43e76bafb2443733240956e11a Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Mon, 26 Feb 2007 12:40:14 +0100 Subject: [PATCH] Some control fixes. --- sugar/graphics/entry.py | 3 ++- sugar/graphics/font.py | 4 +++- sugar/graphics/toolbar.py | 7 ++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/sugar/graphics/entry.py b/sugar/graphics/entry.py index 02e601e1..def08c9e 100644 --- a/sugar/graphics/entry.py +++ b/sugar/graphics/entry.py @@ -39,7 +39,7 @@ class Entry(hippo.CanvasBox, hippo.CanvasItem): 'button-activated': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([int])) } - def __init__(self): + def __init__(self, text=''): hippo.CanvasBox.__init__(self, orientation=hippo.ORIENTATION_HORIZONTAL) self.props.yalign = hippo.ALIGNMENT_CENTER @@ -51,6 +51,7 @@ class Entry(hippo.CanvasBox, hippo.CanvasItem): self._entry = self.create_entry() self._entry.props.has_frame = False + self._entry.props.text = text self._update_colors(focused=False) self._entry.modify_text(gtk.STATE_SELECTED, color.BLACK.get_gdk_color()) diff --git a/sugar/graphics/font.py b/sugar/graphics/font.py index 023dc372..aa4f2dcb 100644 --- a/sugar/graphics/font.py +++ b/sugar/graphics/font.py @@ -3,7 +3,8 @@ import pango from sugar.graphics import units _system_fonts = { - 'default' : 'Bitstream Vera Sans %d' % units.points_to_pixels(9) + 'default' : 'Bitstream Vera Sans %d' % units.points_to_pixels(9), + 'default-bold' : 'Bitstream Vera Sans bold %d' % units.points_to_pixels(9) } class Font(object): @@ -21,3 +22,4 @@ class SystemFont(Font): Font.__init__(self, _system_fonts[font_id]) DEFAULT = SystemFont('default') +DEFAULT_BOLD = SystemFont('default-bold') diff --git a/sugar/graphics/toolbar.py b/sugar/graphics/toolbar.py index 5cd0f65d..3f24afe6 100644 --- a/sugar/graphics/toolbar.py +++ b/sugar/graphics/toolbar.py @@ -1,9 +1,14 @@ import gobject import hippo +from sugar.graphics import units + class Toolbar(hippo.CanvasBox): __gtype_name__ = 'Toolbar' def __init__(self, orientation=hippo.ORIENTATION_HORIZONTAL): hippo.CanvasBox.__init__(self, orientation=orientation, - background_color=0x414141ff) + background_color=0x414141ff, + box_height=units.grid_to_pixels(1), + spacing=units.points_to_pixels(5) +)