Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-07-31 13:02:50 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-07-31 13:02:50 (GMT)
commitf2eca57d132d5e6605210ee2753a12216cf870cb (patch)
tree3b0c1b8a4bb5b7269364f99dba9c4edc87038cd4 /sugar
parent445a79231d1dc1cd97e1acc453deaa7a2f0266da (diff)
More units cleanups
Diffstat (limited to 'sugar')
-rw-r--r--sugar/graphics/objectchooser.py15
-rw-r--r--sugar/graphics/palette.py2
-rw-r--r--sugar/graphics/roundbox.py5
-rw-r--r--sugar/graphics/style.py2
4 files changed, 11 insertions, 13 deletions
diff --git a/sugar/graphics/objectchooser.py b/sugar/graphics/objectchooser.py
index a878ac8..c75cec0 100644
--- a/sugar/graphics/objectchooser.py
+++ b/sugar/graphics/objectchooser.py
@@ -25,7 +25,6 @@ from sugar.graphics.frame import Frame
from sugar.activity.bundle import Bundle
from sugar.date import Date
from sugar.graphics import style
-from sugar.graphics import units
from sugar.graphics.canvasicon import CanvasIcon
from sugar.graphics.xocolor import XoColor
from sugar.datastore import datastore
@@ -43,8 +42,8 @@ class ObjectChooser(gtk.Dialog):
self._box = hippo.CanvasBox()
self._box.props.background_color = style.COLOR_PANEL_GREY.get_int()
- self._box.props.spacing = units.points_to_pixels(5)
- self._box.props.padding = units.points_to_pixels(5)
+ self._box.props.spacing = style.DEFAULT_SPACING
+ self._box.props.padding = style.DEFAULT_SPACING
canvas = hippo.Canvas()
canvas.set_root(self._box)
@@ -97,13 +96,13 @@ class ObjectChooser(gtk.Dialog):
return None
class CollapsedEntry(Frame):
- _DATE_COL_WIDTH = units.points_to_pixels(75)
- _BUDDIES_COL_WIDTH = units.points_to_pixels(30)
+ _DATE_COL_WIDTH = style.zoom(100)
+ _BUDDIES_COL_WIDTH = style.zoom(50)
def __init__(self, jobject):
Frame.__init__(self)
- self.props.box_height = units.grid_to_pixels(1)
- self.props.spacing = units.points_to_pixels(5)
+ self.props.box_height = style.zoom(75)
+ self.props.spacing = style.DEFAULT_SPACING
self.props.border_color = style.COLOR_BLACK.get_int()
self.props.background_color = style.COLOR_PANEL_GREY.get_int()
@@ -117,7 +116,7 @@ class CollapsedEntry(Frame):
self.append(date)
icon = CanvasIcon(icon_name=self._get_icon_name(),
- box_width=units.grid_to_pixels(1))
+ box_width=style.zoom(75))
if self.jobject.metadata.has_key('icon-color'):
icon.props.xo_color = XoColor(self.jobject.metadata['icon-color'])
diff --git a/sugar/graphics/palette.py b/sugar/graphics/palette.py
index a4efca1..45ac057 100644
--- a/sugar/graphics/palette.py
+++ b/sugar/graphics/palette.py
@@ -376,7 +376,7 @@ class Palette(gobject.GObject):
class _PrimaryMenuItem(gtk.MenuItem):
def __init__(self, label, accel_path):
gtk.MenuItem.__init__(self)
- self.set_border_width(style.DEFAULT_BORDER)
+ self.set_border_width(style.DEFAULT_PADDING)
self._set_label(label, accel_path)
def set_label(self, label, accel_path):
diff --git a/sugar/graphics/roundbox.py b/sugar/graphics/roundbox.py
index f1bc854..96a40d7 100644
--- a/sugar/graphics/roundbox.py
+++ b/sugar/graphics/roundbox.py
@@ -19,19 +19,18 @@ import math
import hippo
-from sugar.graphics import units
from sugar.graphics import style
class RoundBox(hippo.CanvasBox, hippo.CanvasItem):
__gtype_name__ = 'SugarRoundBox'
- _BORDER_DEFAULT = units.points_to_pixels(1.0)
+ _BORDER_DEFAULT = style.LINE_WIDTH
def __init__(self, **kwargs):
hippo.CanvasBox.__init__(self, **kwargs)
# TODO: we should calculate this value depending on the height of the box.
- self._radius = units.points_to_pixels(7)
+ self._radius = style.zoom(10)
self.props.orientation = hippo.ORIENTATION_HORIZONTAL
self.props.border = self._BORDER_DEFAULT
diff --git a/sugar/graphics/style.py b/sugar/graphics/style.py
index 336fe10..3198704 100644
--- a/sugar/graphics/style.py
+++ b/sugar/graphics/style.py
@@ -89,7 +89,7 @@ _TAB_CURVATURE = 1
ZOOM_FACTOR = _compute_zoom_factor()
DEFAULT_SPACING = zoom(8)
-DEFAULT_BORDER = zoom(6)
+DEFAULT_PADDING = zoom(6)
LINE_WIDTH = zoom(2)
FONT_SIZE = zoom(7 * _XO_DPI / _get_screen_dpi())