Drop color schemes per design change
This commit is contained in:
parent
a054eb3a4b
commit
3c64b65829
@ -1,5 +1,4 @@
|
|||||||
from sugar.canvas.Menu import Menu
|
from sugar.canvas.Menu import Menu
|
||||||
from sugar.canvas.Menu import MenuColorScheme
|
|
||||||
from sugar.canvas.IconItem import IconItem
|
from sugar.canvas.IconItem import IconItem
|
||||||
from sugar.presence import PresenceService
|
from sugar.presence import PresenceService
|
||||||
|
|
||||||
@ -9,15 +8,7 @@ class BuddyMenu(Menu):
|
|||||||
ACTION_REMOVE_FRIEND = 2
|
ACTION_REMOVE_FRIEND = 2
|
||||||
|
|
||||||
def __init__(self, shell, buddy):
|
def __init__(self, shell, buddy):
|
||||||
color = buddy.get_color()
|
Menu.__init__(self, shell.get_grid(), buddy.get_name())
|
||||||
|
|
||||||
color_scheme = MenuColorScheme()
|
|
||||||
color_scheme.text = 'black'
|
|
||||||
color_scheme.border = color.get_stroke_color()
|
|
||||||
color_scheme.background = color.get_fill_color()
|
|
||||||
color_scheme.separator = 'black'
|
|
||||||
|
|
||||||
Menu.__init__(self, shell.get_grid(), buddy.get_name(), color_scheme)
|
|
||||||
|
|
||||||
self._buddy = buddy
|
self._buddy = buddy
|
||||||
self._shell = shell
|
self._shell = shell
|
||||||
|
@ -9,4 +9,5 @@ sugar_PYTHON = \
|
|||||||
IconColor.py \
|
IconColor.py \
|
||||||
Menu.py \
|
Menu.py \
|
||||||
MenuIcon.py \
|
MenuIcon.py \
|
||||||
MenuShell.py
|
MenuShell.py \
|
||||||
|
Timeline.py
|
||||||
|
@ -6,26 +6,18 @@ from sugar.canvas.CanvasView import CanvasView
|
|||||||
from sugar.canvas.CanvasBox import CanvasBox
|
from sugar.canvas.CanvasBox import CanvasBox
|
||||||
from sugar.canvas.IconItem import IconItem
|
from sugar.canvas.IconItem import IconItem
|
||||||
|
|
||||||
class MenuColorScheme:
|
|
||||||
def __init__(self):
|
|
||||||
self.text = 'white'
|
|
||||||
self.background = 'black'
|
|
||||||
self.border = 'black'
|
|
||||||
self.separator = '#a1a1a1'
|
|
||||||
|
|
||||||
class Menu(gtk.Window):
|
class Menu(gtk.Window):
|
||||||
__gsignals__ = {
|
__gsignals__ = {
|
||||||
'action': (gobject.SIGNAL_RUN_FIRST,
|
'action': (gobject.SIGNAL_RUN_FIRST,
|
||||||
gobject.TYPE_NONE, ([int])),
|
gobject.TYPE_NONE, ([int])),
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, grid, title, color_scheme=MenuColorScheme()):
|
def __init__(self, grid, title):
|
||||||
gtk.Window.__init__(self, gtk.WINDOW_POPUP)
|
gtk.Window.__init__(self, gtk.WINDOW_POPUP)
|
||||||
|
|
||||||
self._width = 15
|
self._width = 15
|
||||||
self._grid = grid
|
self._grid = grid
|
||||||
self._action_box = None
|
self._action_box = None
|
||||||
self._color_scheme = color_scheme
|
|
||||||
|
|
||||||
self._canvas = CanvasView()
|
self._canvas = CanvasView()
|
||||||
self.add(self._canvas)
|
self.add(self._canvas)
|
||||||
@ -34,14 +26,11 @@ class Menu(gtk.Window):
|
|||||||
model = goocanvas.CanvasModelSimple()
|
model = goocanvas.CanvasModelSimple()
|
||||||
self._root = model.get_root_item()
|
self._root = model.get_root_item()
|
||||||
|
|
||||||
self._rect = goocanvas.Rect(fill_color=color_scheme.background,
|
self._rect = goocanvas.Rect(fill_color='black', line_width=0)
|
||||||
stroke_color=color_scheme.border,
|
|
||||||
line_width=3)
|
|
||||||
self._root.add_child(self._rect)
|
self._root.add_child(self._rect)
|
||||||
|
|
||||||
text = goocanvas.Text(text=title, font="Sans bold 18",
|
text = goocanvas.Text(text=title, font="Sans bold 18",
|
||||||
fill_color=color_scheme.text,
|
fill_color='white', anchor=gtk.ANCHOR_SW)
|
||||||
anchor=gtk.ANCHOR_SW)
|
|
||||||
self._grid.set_constraints(text, 1, 3, self._width, 2)
|
self._grid.set_constraints(text, 1, 3, self._width, 2)
|
||||||
self._root.add_child(text)
|
self._root.add_child(text)
|
||||||
|
|
||||||
@ -52,7 +41,7 @@ class Menu(gtk.Window):
|
|||||||
|
|
||||||
def _create_action_box(self):
|
def _create_action_box(self):
|
||||||
separator = goocanvas.Path(data='M 15 0 L 215 0', line_width=3,
|
separator = goocanvas.Path(data='M 15 0 L 215 0', line_width=3,
|
||||||
stroke_color=self._color_scheme.separator)
|
stroke_color='#a1a1a1')
|
||||||
self._grid.set_constraints(separator, 0, 4)
|
self._grid.set_constraints(separator, 0, 4)
|
||||||
self._root.add_child(separator)
|
self._root.add_child(separator)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user