diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-20 13:28:49 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-20 13:28:49 (GMT) |
commit | b44715cf087028b2ac136174c7263fa09a642372 (patch) | |
tree | c5c461c7fd10a77990231e70c49fc0787e64cb4a | |
parent | 7ba58f68b08f51e85170535d10df01f0f1b58236 (diff) |
Remove deprecated style stuff
-rw-r--r-- | sugar/graphics/entry.py | 4 | ||||
-rw-r--r-- | sugar/graphics/label.py | 1 | ||||
-rw-r--r-- | sugar/graphics/optionmenu.py | 10 | ||||
-rw-r--r-- | sugar/graphics/roundbox.py | 4 |
4 files changed, 9 insertions, 10 deletions
diff --git a/sugar/graphics/entry.py b/sugar/graphics/entry.py index 8a79940..490edb2 100644 --- a/sugar/graphics/entry.py +++ b/sugar/graphics/entry.py @@ -21,7 +21,7 @@ import gobject import gtk import hippo -from sugar.graphics import style +from sugar.graphics import units from sugar.graphics import color from sugar.graphics import font from sugar.graphics.button import Button @@ -73,7 +73,7 @@ class Entry(hippo.CanvasBox, hippo.CanvasItem): def add_button(self, icon_name, action_id): button = Button(icon_name=icon_name) - button.props.scale = style.small_icon_scale + button.props.scale = units.SMALL_ICON_SCALE button.props.yalign = hippo.ALIGNMENT_CENTER button.props.xalign = hippo.ALIGNMENT_START diff --git a/sugar/graphics/label.py b/sugar/graphics/label.py index 77519f2..61b961e 100644 --- a/sugar/graphics/label.py +++ b/sugar/graphics/label.py @@ -21,7 +21,6 @@ import gobject import gtk import hippo -from sugar.graphics import style from sugar.graphics.roundbox import RoundBox from sugar.graphics.button import Button from sugar.graphics import color diff --git a/sugar/graphics/optionmenu.py b/sugar/graphics/optionmenu.py index a44d9be..d38971d 100644 --- a/sugar/graphics/optionmenu.py +++ b/sugar/graphics/optionmenu.py @@ -22,7 +22,7 @@ import gobject import gtk import hippo -from sugar.graphics import style +from sugar.graphics import units from sugar.graphics.roundbox import RoundBox from sugar.graphics import button from sugar.graphics import color @@ -40,8 +40,7 @@ class Menu(hippo.CanvasBox, hippo.CanvasItem): hippo.CanvasBox.__init__(self) self.props.background_color = color.MENU_BACKGROUND.get_int() self.props.border_color = color.MENU_BORDER.get_int() - #TODO: how we should specify the border thickness? - self.props.border = style.separator_thickness + self.props.border = units.points_to_pixels(1) self._window = None def add_item(self, action_id, label, icon_name=None, icon_color=None): @@ -49,7 +48,8 @@ class Menu(hippo.CanvasBox, hippo.CanvasItem): box.props.padding = 5 box.props.spacing = 5 if icon_name: - icon = CanvasIcon(icon_name=icon_name, scale=style.small_icon_scale) + icon = CanvasIcon(icon_name=icon_name, + scale=units.SMALL_ICON_SCALE) if icon_color: icon.props.color = icon_color box.append(icon) @@ -67,7 +67,7 @@ class Menu(hippo.CanvasBox, hippo.CanvasItem): def add_separator(self): box = hippo.CanvasBox() box.props.background_color = color.MENU_SEPARATOR.get_int() - box.props.box_height = style.separator_thickness + box.props.box_height = units.points_to_pixels(1) self.append(box) def show(self, x, y): diff --git a/sugar/graphics/roundbox.py b/sugar/graphics/roundbox.py index 9a2c9f6..a24f820 100644 --- a/sugar/graphics/roundbox.py +++ b/sugar/graphics/roundbox.py @@ -19,7 +19,7 @@ import math import hippo -from sugar.graphics import style +from sugar.graphics import units from sugar.graphics import color class RoundBox(hippo.CanvasBox, hippo.CanvasItem): @@ -31,7 +31,7 @@ class RoundBox(hippo.CanvasBox, hippo.CanvasItem): hippo.CanvasBox.__init__(self, **kwargs) # TODO: we should calculate this value depending on the height of the box. - self._radius = 10 * style.screen_factor + self._radius = units.points_to_pixels(10) self.props.orientation = hippo.ORIENTATION_HORIZONTAL self.props.border_top = self._BORDER_DEFAULT |