diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-15 17:48:58 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-15 17:48:58 (GMT) |
commit | 2e8bd12f8bcf9da314d853078ee29f35a381c537 (patch) | |
tree | 3f0922b2484b1a3d9194919fccdb69b5bee587a6 /sugar/graphics/units.py | |
parent | 32c89a1fcb7a536455343b87dc799b800da66380 (diff) |
Rework color and fonts to be more pytonish. Add units conversions.
Diffstat (limited to 'sugar/graphics/units.py')
-rw-r--r-- | sugar/graphics/units.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sugar/graphics/units.py b/sugar/graphics/units.py new file mode 100644 index 0000000..fe39a9f --- /dev/null +++ b/sugar/graphics/units.py @@ -0,0 +1,12 @@ +import gtk + +import _sugar + +def points_to_pixels(points): + return points * _sugar.get_screen_dpi() / 72.0 + +def grid_to_pixels(units): + return units * gtk.gdk.screen_width() / 16 + +def microgrid_to_pixels(units): + return units * gtk.gdk.screen_width() / 80 |