Some control fixes.

This commit is contained in:
Tomeu Vizoso 2007-02-26 12:40:14 +01:00
parent 867b10eed7
commit 6b31f57257
3 changed files with 11 additions and 3 deletions

View File

@ -39,7 +39,7 @@ class Entry(hippo.CanvasBox, hippo.CanvasItem):
'button-activated': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([int])) '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) hippo.CanvasBox.__init__(self, orientation=hippo.ORIENTATION_HORIZONTAL)
self.props.yalign = hippo.ALIGNMENT_CENTER self.props.yalign = hippo.ALIGNMENT_CENTER
@ -51,6 +51,7 @@ class Entry(hippo.CanvasBox, hippo.CanvasItem):
self._entry = self.create_entry() self._entry = self.create_entry()
self._entry.props.has_frame = False self._entry.props.has_frame = False
self._entry.props.text = text
self._update_colors(focused=False) self._update_colors(focused=False)
self._entry.modify_text(gtk.STATE_SELECTED, self._entry.modify_text(gtk.STATE_SELECTED,
color.BLACK.get_gdk_color()) color.BLACK.get_gdk_color())

View File

@ -3,7 +3,8 @@ import pango
from sugar.graphics import units from sugar.graphics import units
_system_fonts = { _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): class Font(object):
@ -21,3 +22,4 @@ class SystemFont(Font):
Font.__init__(self, _system_fonts[font_id]) Font.__init__(self, _system_fonts[font_id])
DEFAULT = SystemFont('default') DEFAULT = SystemFont('default')
DEFAULT_BOLD = SystemFont('default-bold')

View File

@ -1,9 +1,14 @@
import gobject import gobject
import hippo import hippo
from sugar.graphics import units
class Toolbar(hippo.CanvasBox): class Toolbar(hippo.CanvasBox):
__gtype_name__ = 'Toolbar' __gtype_name__ = 'Toolbar'
def __init__(self, orientation=hippo.ORIENTATION_HORIZONTAL): def __init__(self, orientation=hippo.ORIENTATION_HORIZONTAL):
hippo.CanvasBox.__init__(self, orientation=orientation, 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)
)