Some control fixes.
This commit is contained in:
parent
867b10eed7
commit
6b31f57257
@ -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())
|
||||
|
@ -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')
|
||||
|
@ -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)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user