diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-08-12 23:17:37 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-08-12 23:17:37 (GMT) |
commit | 2ae043c1fe63429c10120f9984a3451e959a695e (patch) | |
tree | ce5f5759e478406272a0fdc1884aa47eb0033099 /sugar | |
parent | dcef110223e312d44955ca4aa1e2f306b9cb9e12 (diff) |
Add option to use the same style values as on the XO.
Useful to test/debug size issues, if you have a screen
that can do 1600x1200.
Diffstat (limited to 'sugar')
-rw-r--r-- | sugar/graphics/style.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sugar/graphics/style.py b/sugar/graphics/style.py index a5186da..c0094b6 100644 --- a/sugar/graphics/style.py +++ b/sugar/graphics/style.py @@ -15,14 +15,20 @@ # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. +import os + import gtk import pango def _get_screen_dpi(): xft_dpi = gtk.settings_get_default().get_property('gtk-xft-dpi') - return float(xft_dpi / 1024) + return float(xft_dpi / 1024) def _compute_zoom_factor(): + if os.environ.has_key('SUGAR_XO_STYLE'): + if os.environ['SUGAR_XO_STYLE'] == 'yes': + return 1.0 + return gtk.gdk.screen_width() / 1200.0 def zoom(units): |