Move all the canvas code that doesn't depend on goocanvas anymore in graphics.
This commit is contained in:
@@ -7,7 +7,7 @@ import rsvg
|
||||
import cairo
|
||||
|
||||
from sugar.util import GObjectSingletonMeta
|
||||
from sugar.canvas.IconColor import IconColor
|
||||
from sugar.graphics.iconcolor import IconColor
|
||||
|
||||
class _IconCache:
|
||||
def __init__(self):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import gtk
|
||||
|
||||
from sugar.graphics import style
|
||||
from sugar.canvas.IconColor import IconColor
|
||||
from sugar.graphics.iconcolor import IconColor
|
||||
|
||||
if gtk.gdk.screen_width() == 1200:
|
||||
_medium_icon_size = 75
|
||||
|
||||
@@ -6,7 +6,7 @@ import hippo
|
||||
import rsvg
|
||||
import cairo
|
||||
|
||||
from sugar.canvas.IconColor import IconColor
|
||||
from sugar.graphics.iconcolor import IconColor
|
||||
|
||||
class _IconCache:
|
||||
def __init__(self):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import random
|
||||
|
||||
from sugar.canvas import Colors
|
||||
from sugar.graphics.colors import colors
|
||||
|
||||
def _parse_string(color_string):
|
||||
if color_string == 'white':
|
||||
@@ -18,8 +18,8 @@ def is_valid(color_string):
|
||||
class IconColor:
|
||||
def __init__(self, color_string=None):
|
||||
if color_string == None or not is_valid(color_string):
|
||||
n = int(random.random() * (len(Colors.colors) - 1))
|
||||
[self._stroke, self._fill] = Colors.colors[n]
|
||||
n = int(random.random() * (len(colors) - 1))
|
||||
[self._stroke, self._fill] = colors[n]
|
||||
else:
|
||||
[self._stroke, self._fill] = _parse_string(color_string)
|
||||
|
||||
Reference in New Issue
Block a user