More work to get rid of stylesheets, some regressions.

This commit is contained in:
Marco Pesenti Gritti 2007-02-20 14:57:50 +01:00
parent b44715cf08
commit ee66b2237d
9 changed files with 17 additions and 48 deletions

View File

@ -19,8 +19,6 @@ import logging
import gobject
import wnck
import view.stylesheet
from sugar.graphics import style
from view.home.HomeWindow import HomeWindow
from sugar.presence import PresenceService
from view.ActivityHost import ActivityHost
@ -41,8 +39,6 @@ class Shell(gobject.GObject):
self._current_host = None
self._screen_rotation = 0
style.load_stylesheet(view.stylesheet)
self._hw_manager = HardwareManager()
self._audio_manager = AudioManager()

View File

@ -3,17 +3,14 @@ import hippo
from sugar.graphics.menu import Menu
from sugar.graphics.canvasicon import CanvasIcon
from sugar.graphics.ClipboardBubble import ClipboardBubble
from sugar.graphics import style
class ClipboardMenuItem(ClipboardBubble):
def __init__(self, percent = 0, stylesheet="clipboard.Bubble"):
def __init__(self, percent = 0):
self._text_item = None
ClipboardBubble.__init__(self, percent=percent)
style.apply_stylesheet(self, stylesheet)
self._text_item = hippo.CanvasText(text=str(percent) + ' %')
style.apply_stylesheet(self._text_item, 'clipboard.MenuItem.Title')
self.append(self._text_item)
def do_set_property(self, pspec, value):

View File

@ -17,16 +17,20 @@
import hippo
import logging
from sugar.graphics import units
from sugar.graphics.iconcolor import IconColor
from sugar.graphics.canvasicon import CanvasIcon
from sugar.presence import PresenceService
from sugar.graphics import style
from sugar import profile
class ActivityItem(CanvasIcon):
def __init__(self, activity):
icon_name = activity.get_icon()
CanvasIcon.__init__(self, icon_name=icon_name)
style.apply_stylesheet(self, 'frame.ActivityIcon')
CanvasIcon.__init__(self, icon_name=icon_name,
box_width=units.grid_to_pixels(1),
box_height=units.grid_to_pixels(1),
color=IconColor('white'))
self._activity = activity
self._normal_color = self.get_property('color')
self._prelight_color = profile.get_color()
@ -44,9 +48,10 @@ class ActivityItem(CanvasIcon):
class InviteItem(CanvasIcon):
def __init__(self, activity, invite):
CanvasIcon.__init__(self, icon_name=activity.get_icon())
CanvasIcon.__init__(self, icon_name=activity.get_icon(),
box_width=units.grid_to_pixels(1),
box_height=units.grid_to_pixels(1))
style.apply_stylesheet(self, 'frame.ActivityIcon')
self.props.color = activity.get_color()
self._invite = invite

View File

@ -18,7 +18,6 @@ import hippo
from sugar.graphics.canvasicon import CanvasIcon
from sugar.graphics.iconcolor import IconColor
from sugar.graphics import style
from sugar.presence import PresenceService
from view.BuddyIcon import BuddyIcon
from model.BuddyModel import BuddyModel
@ -51,7 +50,6 @@ class FriendsBox(hippo.CanvasBox):
model = BuddyModel(buddy=buddy)
icon = BuddyIcon(self._shell, self._menu_shell, model)
style.apply_stylesheet(icon, 'frame.BuddyIcon')
self.append(icon)
self._buddies[buddy.get_name()] = icon

View File

@ -3,7 +3,6 @@ import hippo
import gtk
from sugar import util
from sugar.graphics import style
from view.clipboardicon import ClipboardIcon
from sugar.clipboard import clipboardservice
@ -76,7 +75,6 @@ class ClipboardBox(hippo.CanvasBox):
def _object_added_cb(self, cb_service, object_id, name):
icon = ClipboardIcon(self._menu_shell, object_id, name)
style.apply_stylesheet(icon, 'frame.BuddyIcon')
self.append(icon)
self._icons[object_id] = icon

View File

@ -19,7 +19,7 @@ import gobject
from view.BuddyIcon import BuddyIcon
from sugar.graphics.canvasicon import CanvasIcon
from sugar.graphics import style
from sugar.graphics import units
from sugar.presence import PresenceService
class FriendView(hippo.CanvasBox):
@ -30,11 +30,10 @@ class FriendView(hippo.CanvasBox):
self._buddy = buddy
self._buddy_icon = BuddyIcon(shell, menu_shell, buddy)
style.apply_stylesheet(self._buddy_icon, 'friends.FriendIcon')
self._buddy_icon.props.scale = units.LARGE_ICON_SCALE
self.append(self._buddy_icon)
self._activity_icon = CanvasIcon()
style.apply_stylesheet(self._activity_icon, 'friends.ActivityIcon')
self._activity_icon = CanvasIcon(scale=units.LARGE_ICON_SCALE)
self._activity_icon_visible = False
if self._buddy.is_present():

View File

@ -20,7 +20,7 @@ import gobject
import colorsys
from sugar.graphics.canvasicon import CanvasIcon
from sugar.graphics import style
from sugar.graphics import units
from sugar.graphics import iconcolor
from sugar import profile
@ -55,8 +55,8 @@ class ActivityIcon(CanvasIcon):
self._level = self._level_max
color = self._icon_colors[self._level]
CanvasIcon.__init__(self, icon_name=icon_name, color=color, cache=True)
style.apply_stylesheet(self, 'ring.ActivityIcon')
CanvasIcon.__init__(self, icon_name=icon_name, color=color,
scale=units.MEDIUM_ICON_SCALE, cache=True)
self._activity = activity
self._launched = False

View File

@ -23,30 +23,10 @@ from sugar.graphics.grid import Grid
grid = Grid()
frame_ActivityIcon = {
'color' : IconColor('white'),
'box-width' : grid.dimension(1),
'scale' : style.standard_icon_scale
}
frame_BuddyIcon = {
'box-width' : grid.dimension(1),
'box-height' : grid.dimension(1),
'scale' : style.standard_icon_scale
}
ring_ActivityIcon = {
'scale' : style.medium_icon_scale
}
friends_FriendIcon = {
'scale' : style.large_icon_scale
}
friends_ActivityIcon = {
'scale' : style.standard_icon_scale
}
clipboard_Bubble = {
'fill-color' : 0x646464FF,
'stroke-color' : 0x646464FF,

View File

@ -1,4 +0,0 @@
from sugar.graphics import style
from sugar.graphics import stylesheet
style.load_stylesheet(stylesheet)