Skeleton group chat activity.
Fix positioning in the activity bar.
This commit is contained in:
parent
5a2653bf1e
commit
f8c4f0bd66
@ -1 +1 @@
|
||||
SUBDIRS = browser chat terminal
|
||||
SUBDIRS = browser chat groupchat terminal
|
||||
|
@ -1,7 +1,7 @@
|
||||
[Activity]
|
||||
name = Web
|
||||
id = com.redhat.Sugar.BrowserActivity
|
||||
icon = browser-activity
|
||||
icon = activity-web
|
||||
python_module = browser.BrowserActivity.BrowserActivity
|
||||
default_type = _web_olpc._udp
|
||||
show_launcher = yes
|
||||
|
8
activities/groupchat/GroupChatActivity.py
Normal file
8
activities/groupchat/GroupChatActivity.py
Normal file
@ -0,0 +1,8 @@
|
||||
from gettext import gettext as _
|
||||
|
||||
from sugar.activity.Activity import Activity
|
||||
|
||||
class GroupChatActivity(Activity):
|
||||
def __init__(self):
|
||||
Activity.__init__(self)
|
||||
self.set_title(_('Group chat'))
|
6
activities/groupchat/Makefile.am
Normal file
6
activities/groupchat/Makefile.am
Normal file
@ -0,0 +1,6 @@
|
||||
sugardir = $(pkgdatadir)/activities/groupchat
|
||||
sugar_PYTHON = \
|
||||
__init__.py \
|
||||
GroupChatActivity.py
|
||||
|
||||
EXTRA_DIST = groupchat.activity
|
0
activities/groupchat/__init__.py
Normal file
0
activities/groupchat/__init__.py
Normal file
6
activities/groupchat/groupchat.activity
Normal file
6
activities/groupchat/groupchat.activity
Normal file
@ -0,0 +1,6 @@
|
||||
[Activity]
|
||||
name = GroupChat
|
||||
icon = activity-groupchat
|
||||
id = com.redhat.Sugar.GroupChatActivity
|
||||
python_module = groupchat.GroupChatActivity.GroupChatActivity
|
||||
show_launcher = yes
|
@ -27,6 +27,7 @@ dbus-installed.conf
|
||||
activities/Makefile
|
||||
activities/browser/Makefile
|
||||
activities/chat/Makefile
|
||||
activities/groupchat/Makefile
|
||||
activities/terminal/Makefile
|
||||
shell/Makefile
|
||||
shell/data/Makefile
|
||||
|
@ -38,8 +38,11 @@ class TasksItem(DonutItem):
|
||||
self._items[activity.get_id()] = item
|
||||
|
||||
class ActivityItem(IconItem):
|
||||
ICON_SIZE = 30
|
||||
|
||||
def __init__(self, activity):
|
||||
IconItem.__init__(self, activity.get_icon(), 'white', 30)
|
||||
IconItem.__init__(self, activity.get_icon(), 'white',
|
||||
ActivityItem.ICON_SIZE)
|
||||
self._activity = activity
|
||||
|
||||
def get_activity_id(self):
|
||||
@ -58,6 +61,8 @@ class ActivityBar(goocanvas.Group):
|
||||
|
||||
def add_activity(self, activity):
|
||||
item = ActivityItem(activity)
|
||||
x = (ActivityItem.ICON_SIZE + 6) * self.get_n_children()
|
||||
item.set_property('x', x)
|
||||
self.add_child(item)
|
||||
|
||||
class Background(goocanvas.Group):
|
||||
|
@ -21,9 +21,12 @@ class IconCache(gobject.GObject):
|
||||
icon_file.close()
|
||||
|
||||
if color != None:
|
||||
style = '.fill-color {fill: %s; stroke: %s;}' % (color, color)
|
||||
style = '.fill-color {fill: %s;}' % (color)
|
||||
data = re.sub('\.fill-color \{.*\}', style, data)
|
||||
|
||||
style = '.fill-and-stroke-color {fill: %s; stroke: %s;}' % (color, color)
|
||||
data = re.sub('\.fill-and-stroke-color \{.*\}', style, data)
|
||||
|
||||
loader = gtk.gdk.pixbuf_loader_new_with_mime_type('image/svg-xml')
|
||||
loader.set_size(size, size)
|
||||
loader.write(data)
|
||||
|
Loading…
Reference in New Issue
Block a user