More stylsheets work

This commit is contained in:
Marco Pesenti Gritti 2006-10-05 14:52:33 +02:00
parent 250060b7f8
commit 0bd96b3987
5 changed files with 19 additions and 8 deletions

View File

@ -15,11 +15,9 @@ class ActivityMenu(Menu):
Menu.__init__(self, activity_host.get_title())
icon = CanvasIcon(icon_name='stock-share-mesh')
style.apply_stylesheet(icon, 'menu.ActionIcon')
self.add_action(icon, ActivityMenu.ACTION_SHARE)
icon = CanvasIcon(icon_name='stock-close')
style.apply_stylesheet(icon, 'menu.ActionIcon')
self.add_action(icon, ActivityMenu.ACTION_CLOSE)
class ActivityIcon(MenuIcon):

View File

@ -1,13 +1,14 @@
import hippo
import gobject
import BuddyIcon
from view.BuddyIcon import BuddyIcon
from sugar.graphics.canvasicon import CanvasIcon
from sugar.graphics import style
from sugar.presence import PresenceService
import conf
class BuddyActivityView(hippo.CanvasBox):
class FriendView(hippo.CanvasBox):
def __init__(self, shell, menu_shell, buddy, **kwargs):
hippo.CanvasBox.__init__(self, **kwargs)
@ -15,10 +16,12 @@ class BuddyActivityView(hippo.CanvasBox):
self._activity_registry = conf.get_activity_registry()
self._buddy = buddy
self._buddy_icon = BuddyIcon.BuddyIcon(shell, menu_shell, buddy)
self._buddy_icon = BuddyIcon(shell, menu_shell, buddy)
style.apply_stylesheet(self._buddy_icon, 'friends.FriendIcon')
self.append(self._buddy_icon)
self._activity_icon = CanvasIcon(size=48)
self._activity_icon = CanvasIcon()
style.apply_stylesheet(self._activity_icon, 'friends.ActivityIcon')
self._activity_icon_visible = False
if self._buddy.is_present():

View File

@ -5,7 +5,7 @@ import hippo
from sugar.graphics.spreadlayout import SpreadLayout
from sugar.graphics import style
from view.home.MyIcon import MyIcon
from view.BuddyActivityView import BuddyActivityView
from view.home.FriendView import FriendView
class FriendsBox(hippo.CanvasBox, hippo.CanvasItem):
__gtype_name__ = 'SugarFriendsBox'
@ -30,7 +30,7 @@ class FriendsBox(hippo.CanvasBox, hippo.CanvasItem):
friends.connect('friend-removed', self._friend_removed_cb)
def add_friend(self, buddy_info):
icon = BuddyActivityView(self._shell, self._menu_shell, buddy_info)
icon = FriendView(self._shell, self._menu_shell, buddy_info)
self.append(icon, hippo.PACK_FIXED)
self._friends[buddy_info.get_name()] = icon

View File

@ -34,3 +34,11 @@ home_MyIcon = {
friends_MyIcon = {
'size' : _large_icon_size
}
friends_FriendIcon = {
'size' : _large_icon_size
}
friends_ActivityIcon = {
'size' : _standard_icon_size
}

View File

@ -3,6 +3,7 @@ import hippo
import gobject
from sugar.graphics.canvasicon import CanvasIcon
from sugar.graphics import style
class Menu(gtk.Window):
__gsignals__ = {
@ -43,6 +44,7 @@ class Menu(gtk.Window):
return separator
def add_action(self, icon, action_id):
style.apply_stylesheet(icon, 'menu.ActionIcon')
icon.connect('activated', self._action_clicked_cb, action_id)
self._action_box.append(icon)