diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-15 18:03:24 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-15 18:03:24 (GMT) |
commit | fa4c775bc9b0647c5e5a075ecc7b98067ebf7584 (patch) | |
tree | d5f137aadb67b212ee78ad478f41208151f1ada0 /sugar/graphics/units.py | |
parent | 67c9268a753f4e73ddc480462633b03ee28f9397 (diff) |
Add icon sizes
Diffstat (limited to 'sugar/graphics/units.py')
-rw-r--r-- | sugar/graphics/units.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sugar/graphics/units.py b/sugar/graphics/units.py index 866a3d6..04c72dd 100644 --- a/sugar/graphics/units.py +++ b/sugar/graphics/units.py @@ -2,9 +2,16 @@ import gtk import _sugar +_screen_factor = gtk.gdk.screen_width() / 1200.0 + +STANDARD_ICON_SCALE = 1.0 * _screen_factor +SMALL_ICON_SCALE = 0.5 * _screen_factor +MEDIUM_ICON_SCALE = 1.5 * _screen_factor +LARGE_ICON_SCALE = 2.0 * _screen_factor +XLARGE_ICON_SCALE = 3.0 * _screen_factor + def points_to_pixels(points): - screen_factor = gtk.gdk.screen_width() / 1200.0 - return points * _sugar.get_screen_dpi() / 72.0 * screen_factor + return points * _sugar.get_screen_dpi() / 72.0 * _screen_factor def grid_to_pixels(units): return units * gtk.gdk.screen_width() / 16 |