Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/graphics
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-02-26 11:40:14 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-02-26 11:40:14 (GMT)
commit6b31f572574dde43e76bafb2443733240956e11a (patch)
treef80ad6de8d8fd9fd0aa8baed89ae33fea2d21e47 /sugar/graphics
parent867b10eed7b5fc4d95a35b0af339ef2fd510d330 (diff)
Some control fixes.
Diffstat (limited to 'sugar/graphics')
-rw-r--r--sugar/graphics/entry.py3
-rw-r--r--sugar/graphics/font.py4
-rw-r--r--sugar/graphics/toolbar.py7
3 files changed, 11 insertions, 3 deletions
diff --git a/sugar/graphics/entry.py b/sugar/graphics/entry.py
index 02e601e..def08c9 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 023dc37..aa4f2dc 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 5cd0f65..3f24afe 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)
+)