More work to get rid of stylesheets, some regressions.
This commit is contained in:
parent
b44715cf08
commit
ee66b2237d
@ -19,8 +19,6 @@ import logging
|
|||||||
import gobject
|
import gobject
|
||||||
import wnck
|
import wnck
|
||||||
|
|
||||||
import view.stylesheet
|
|
||||||
from sugar.graphics import style
|
|
||||||
from view.home.HomeWindow import HomeWindow
|
from view.home.HomeWindow import HomeWindow
|
||||||
from sugar.presence import PresenceService
|
from sugar.presence import PresenceService
|
||||||
from view.ActivityHost import ActivityHost
|
from view.ActivityHost import ActivityHost
|
||||||
@ -41,8 +39,6 @@ class Shell(gobject.GObject):
|
|||||||
self._current_host = None
|
self._current_host = None
|
||||||
self._screen_rotation = 0
|
self._screen_rotation = 0
|
||||||
|
|
||||||
style.load_stylesheet(view.stylesheet)
|
|
||||||
|
|
||||||
self._hw_manager = HardwareManager()
|
self._hw_manager = HardwareManager()
|
||||||
self._audio_manager = AudioManager()
|
self._audio_manager = AudioManager()
|
||||||
|
|
||||||
|
@ -3,17 +3,14 @@ import hippo
|
|||||||
from sugar.graphics.menu import Menu
|
from sugar.graphics.menu import Menu
|
||||||
from sugar.graphics.canvasicon import CanvasIcon
|
from sugar.graphics.canvasicon import CanvasIcon
|
||||||
from sugar.graphics.ClipboardBubble import ClipboardBubble
|
from sugar.graphics.ClipboardBubble import ClipboardBubble
|
||||||
from sugar.graphics import style
|
|
||||||
|
|
||||||
class ClipboardMenuItem(ClipboardBubble):
|
class ClipboardMenuItem(ClipboardBubble):
|
||||||
|
|
||||||
def __init__(self, percent = 0, stylesheet="clipboard.Bubble"):
|
def __init__(self, percent = 0):
|
||||||
self._text_item = None
|
self._text_item = None
|
||||||
ClipboardBubble.__init__(self, percent=percent)
|
ClipboardBubble.__init__(self, percent=percent)
|
||||||
style.apply_stylesheet(self, stylesheet)
|
|
||||||
|
|
||||||
self._text_item = hippo.CanvasText(text=str(percent) + ' %')
|
self._text_item = hippo.CanvasText(text=str(percent) + ' %')
|
||||||
style.apply_stylesheet(self._text_item, 'clipboard.MenuItem.Title')
|
|
||||||
self.append(self._text_item)
|
self.append(self._text_item)
|
||||||
|
|
||||||
def do_set_property(self, pspec, value):
|
def do_set_property(self, pspec, value):
|
||||||
|
@ -17,16 +17,20 @@
|
|||||||
import hippo
|
import hippo
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from sugar.graphics import units
|
||||||
|
from sugar.graphics.iconcolor import IconColor
|
||||||
from sugar.graphics.canvasicon import CanvasIcon
|
from sugar.graphics.canvasicon import CanvasIcon
|
||||||
from sugar.presence import PresenceService
|
from sugar.presence import PresenceService
|
||||||
from sugar.graphics import style
|
|
||||||
from sugar import profile
|
from sugar import profile
|
||||||
|
|
||||||
class ActivityItem(CanvasIcon):
|
class ActivityItem(CanvasIcon):
|
||||||
def __init__(self, activity):
|
def __init__(self, activity):
|
||||||
icon_name = activity.get_icon()
|
icon_name = activity.get_icon()
|
||||||
CanvasIcon.__init__(self, icon_name=icon_name)
|
CanvasIcon.__init__(self, icon_name=icon_name,
|
||||||
style.apply_stylesheet(self, 'frame.ActivityIcon')
|
box_width=units.grid_to_pixels(1),
|
||||||
|
box_height=units.grid_to_pixels(1),
|
||||||
|
color=IconColor('white'))
|
||||||
|
|
||||||
self._activity = activity
|
self._activity = activity
|
||||||
self._normal_color = self.get_property('color')
|
self._normal_color = self.get_property('color')
|
||||||
self._prelight_color = profile.get_color()
|
self._prelight_color = profile.get_color()
|
||||||
@ -44,9 +48,10 @@ class ActivityItem(CanvasIcon):
|
|||||||
|
|
||||||
class InviteItem(CanvasIcon):
|
class InviteItem(CanvasIcon):
|
||||||
def __init__(self, activity, invite):
|
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.props.color = activity.get_color()
|
||||||
|
|
||||||
self._invite = invite
|
self._invite = invite
|
||||||
|
@ -18,7 +18,6 @@ import hippo
|
|||||||
|
|
||||||
from sugar.graphics.canvasicon import CanvasIcon
|
from sugar.graphics.canvasicon import CanvasIcon
|
||||||
from sugar.graphics.iconcolor import IconColor
|
from sugar.graphics.iconcolor import IconColor
|
||||||
from sugar.graphics import style
|
|
||||||
from sugar.presence import PresenceService
|
from sugar.presence import PresenceService
|
||||||
from view.BuddyIcon import BuddyIcon
|
from view.BuddyIcon import BuddyIcon
|
||||||
from model.BuddyModel import BuddyModel
|
from model.BuddyModel import BuddyModel
|
||||||
@ -51,7 +50,6 @@ class FriendsBox(hippo.CanvasBox):
|
|||||||
|
|
||||||
model = BuddyModel(buddy=buddy)
|
model = BuddyModel(buddy=buddy)
|
||||||
icon = BuddyIcon(self._shell, self._menu_shell, model)
|
icon = BuddyIcon(self._shell, self._menu_shell, model)
|
||||||
style.apply_stylesheet(icon, 'frame.BuddyIcon')
|
|
||||||
self.append(icon)
|
self.append(icon)
|
||||||
|
|
||||||
self._buddies[buddy.get_name()] = icon
|
self._buddies[buddy.get_name()] = icon
|
||||||
|
@ -3,7 +3,6 @@ import hippo
|
|||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from sugar import util
|
from sugar import util
|
||||||
from sugar.graphics import style
|
|
||||||
from view.clipboardicon import ClipboardIcon
|
from view.clipboardicon import ClipboardIcon
|
||||||
from sugar.clipboard import clipboardservice
|
from sugar.clipboard import clipboardservice
|
||||||
|
|
||||||
@ -76,7 +75,6 @@ class ClipboardBox(hippo.CanvasBox):
|
|||||||
|
|
||||||
def _object_added_cb(self, cb_service, object_id, name):
|
def _object_added_cb(self, cb_service, object_id, name):
|
||||||
icon = ClipboardIcon(self._menu_shell, object_id, name)
|
icon = ClipboardIcon(self._menu_shell, object_id, name)
|
||||||
style.apply_stylesheet(icon, 'frame.BuddyIcon')
|
|
||||||
self.append(icon)
|
self.append(icon)
|
||||||
self._icons[object_id] = icon
|
self._icons[object_id] = icon
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import gobject
|
|||||||
|
|
||||||
from view.BuddyIcon import BuddyIcon
|
from view.BuddyIcon import BuddyIcon
|
||||||
from sugar.graphics.canvasicon import CanvasIcon
|
from sugar.graphics.canvasicon import CanvasIcon
|
||||||
from sugar.graphics import style
|
from sugar.graphics import units
|
||||||
from sugar.presence import PresenceService
|
from sugar.presence import PresenceService
|
||||||
|
|
||||||
class FriendView(hippo.CanvasBox):
|
class FriendView(hippo.CanvasBox):
|
||||||
@ -30,11 +30,10 @@ class FriendView(hippo.CanvasBox):
|
|||||||
|
|
||||||
self._buddy = buddy
|
self._buddy = buddy
|
||||||
self._buddy_icon = BuddyIcon(shell, menu_shell, 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.append(self._buddy_icon)
|
||||||
|
|
||||||
self._activity_icon = CanvasIcon()
|
self._activity_icon = CanvasIcon(scale=units.LARGE_ICON_SCALE)
|
||||||
style.apply_stylesheet(self._activity_icon, 'friends.ActivityIcon')
|
|
||||||
self._activity_icon_visible = False
|
self._activity_icon_visible = False
|
||||||
|
|
||||||
if self._buddy.is_present():
|
if self._buddy.is_present():
|
||||||
|
@ -20,7 +20,7 @@ import gobject
|
|||||||
import colorsys
|
import colorsys
|
||||||
|
|
||||||
from sugar.graphics.canvasicon import CanvasIcon
|
from sugar.graphics.canvasicon import CanvasIcon
|
||||||
from sugar.graphics import style
|
from sugar.graphics import units
|
||||||
from sugar.graphics import iconcolor
|
from sugar.graphics import iconcolor
|
||||||
from sugar import profile
|
from sugar import profile
|
||||||
|
|
||||||
@ -55,8 +55,8 @@ class ActivityIcon(CanvasIcon):
|
|||||||
self._level = self._level_max
|
self._level = self._level_max
|
||||||
color = self._icon_colors[self._level]
|
color = self._icon_colors[self._level]
|
||||||
|
|
||||||
CanvasIcon.__init__(self, icon_name=icon_name, color=color, cache=True)
|
CanvasIcon.__init__(self, icon_name=icon_name, color=color,
|
||||||
style.apply_stylesheet(self, 'ring.ActivityIcon')
|
scale=units.MEDIUM_ICON_SCALE, cache=True)
|
||||||
|
|
||||||
self._activity = activity
|
self._activity = activity
|
||||||
self._launched = False
|
self._launched = False
|
||||||
|
@ -23,30 +23,10 @@ from sugar.graphics.grid import Grid
|
|||||||
|
|
||||||
grid = 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 = {
|
friends_FriendIcon = {
|
||||||
'scale' : style.large_icon_scale
|
'scale' : style.large_icon_scale
|
||||||
}
|
}
|
||||||
|
|
||||||
friends_ActivityIcon = {
|
|
||||||
'scale' : style.standard_icon_scale
|
|
||||||
}
|
|
||||||
|
|
||||||
clipboard_Bubble = {
|
clipboard_Bubble = {
|
||||||
'fill-color' : 0x646464FF,
|
'fill-color' : 0x646464FF,
|
||||||
'stroke-color' : 0x646464FF,
|
'stroke-color' : 0x646464FF,
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
from sugar.graphics import style
|
|
||||||
from sugar.graphics import stylesheet
|
|
||||||
|
|
||||||
style.load_stylesheet(stylesheet)
|
|
Loading…
Reference in New Issue
Block a user