Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/graphics/style.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/sugar/graphics/style.py')
-rw-r--r--src/sugar/graphics/style.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sugar/graphics/style.py b/src/sugar/graphics/style.py
index e63e5ca..6d5e35e 100644
--- a/src/sugar/graphics/style.py
+++ b/src/sugar/graphics/style.py
@@ -28,9 +28,11 @@ import logging
import gtk
import pango
+
FOCUS_LINE_WIDTH = 2
_TAB_CURVATURE = 1
+
def _compute_zoom_factor():
if os.environ.has_key('SUGAR_SCALING'):
try:
@@ -41,7 +43,9 @@ def _compute_zoom_factor():
return 1.0
+
class Font(object):
+
def __init__(self, desc):
self._desc = desc
@@ -51,7 +55,9 @@ class Font(object):
def get_pango_desc(self):
return pango.FontDescription(self._desc)
+
class Color(object):
+
def __init__(self, color, alpha=1.0):
self._r, self._g, self._b = self._html_to_rgb(color)
self._a = alpha
@@ -91,9 +97,11 @@ class Color(object):
else:
return self.get_html()
+
def zoom(units):
return int(ZOOM_FACTOR * units)
+
ZOOM_FACTOR = _compute_zoom_factor()
DEFAULT_SPACING = zoom(15)