Convert to the new icon format
This commit is contained in:
@@ -4,7 +4,7 @@ from sugar.canvas import Colors
|
||||
|
||||
def _parse_string(color_string):
|
||||
if color_string == 'white':
|
||||
return ['white', '#4f4f4f']
|
||||
return ['#ffffff', '#4f4f4f']
|
||||
|
||||
splitted = color_string.split(',')
|
||||
if len(splitted) == 2:
|
||||
|
||||
@@ -25,15 +25,12 @@ class _IconCache:
|
||||
|
||||
fill = color.get_fill_color()
|
||||
stroke = color.get_stroke_color()
|
||||
|
||||
entity = '<!ENTITY fill_color "%s">' % fill
|
||||
data = re.sub('<!ENTITY fill_color .*>', entity, data)
|
||||
|
||||
style = '.fill {fill:%s;stroke:%s;}' % (fill, fill)
|
||||
data = re.sub('\.fill \{.*\}', style, data)
|
||||
|
||||
style = '.shape {stroke:%s;fill:%s;}' % (stroke, stroke)
|
||||
data = re.sub('\.shape \{.*\}', style, data)
|
||||
|
||||
style = '.shape-and-fill {fill:%s; stroke:%s;}' % (fill, stroke)
|
||||
data = re.sub('\.shape-and-fill \{.*\}', style, data)
|
||||
entity = '<!ENTITY stroke_color "%s">' % stroke
|
||||
data = re.sub('<!ENTITY stroke_color .*>', entity, data)
|
||||
|
||||
return rsvg.Handle(data=data)
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class Menu(gtk.Window):
|
||||
self._grid.set_constraints(separator, 0, 4)
|
||||
self._root.add_child(separator)
|
||||
|
||||
box = CanvasBox(self._grid, CanvasBox.HORIZONTAL, 1)
|
||||
box = CanvasBox(self._grid, CanvasBox.HORIZONTAL)
|
||||
self._grid.set_constraints(box, 0, 5)
|
||||
|
||||
return box
|
||||
@@ -62,7 +62,7 @@ class Menu(gtk.Window):
|
||||
self._update_constraints()
|
||||
|
||||
icon.connect('clicked', self._action_clicked_cb, action_id)
|
||||
self._action_box.set_constraints(icon, 3, 3)
|
||||
self._action_box.set_constraints(icon, 5, 5)
|
||||
self._action_box.add_child(icon)
|
||||
|
||||
def _action_clicked_cb(self, icon, action):
|
||||
|
||||
Reference in New Issue
Block a user