Skeleton group chat activity.

Fix positioning in the activity bar.
This commit is contained in:
Marco Pesenti Gritti 2006-08-19 11:54:41 +02:00
parent 5a2653bf1e
commit f8c4f0bd66
9 changed files with 33 additions and 4 deletions

View File

@ -1 +1 @@
SUBDIRS = browser chat terminal SUBDIRS = browser chat groupchat terminal

View File

@ -1,7 +1,7 @@
[Activity] [Activity]
name = Web name = Web
id = com.redhat.Sugar.BrowserActivity id = com.redhat.Sugar.BrowserActivity
icon = browser-activity icon = activity-web
python_module = browser.BrowserActivity.BrowserActivity python_module = browser.BrowserActivity.BrowserActivity
default_type = _web_olpc._udp default_type = _web_olpc._udp
show_launcher = yes show_launcher = yes

View 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'))

View File

@ -0,0 +1,6 @@
sugardir = $(pkgdatadir)/activities/groupchat
sugar_PYTHON = \
__init__.py \
GroupChatActivity.py
EXTRA_DIST = groupchat.activity

View File

View File

@ -0,0 +1,6 @@
[Activity]
name = GroupChat
icon = activity-groupchat
id = com.redhat.Sugar.GroupChatActivity
python_module = groupchat.GroupChatActivity.GroupChatActivity
show_launcher = yes

View File

@ -27,6 +27,7 @@ dbus-installed.conf
activities/Makefile activities/Makefile
activities/browser/Makefile activities/browser/Makefile
activities/chat/Makefile activities/chat/Makefile
activities/groupchat/Makefile
activities/terminal/Makefile activities/terminal/Makefile
shell/Makefile shell/Makefile
shell/data/Makefile shell/data/Makefile

View File

@ -38,8 +38,11 @@ class TasksItem(DonutItem):
self._items[activity.get_id()] = item self._items[activity.get_id()] = item
class ActivityItem(IconItem): class ActivityItem(IconItem):
ICON_SIZE = 30
def __init__(self, activity): 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 self._activity = activity
def get_activity_id(self): def get_activity_id(self):
@ -58,6 +61,8 @@ class ActivityBar(goocanvas.Group):
def add_activity(self, activity): def add_activity(self, activity):
item = ActivityItem(activity) item = ActivityItem(activity)
x = (ActivityItem.ICON_SIZE + 6) * self.get_n_children()
item.set_property('x', x)
self.add_child(item) self.add_child(item)
class Background(goocanvas.Group): class Background(goocanvas.Group):

View File

@ -21,9 +21,12 @@ class IconCache(gobject.GObject):
icon_file.close() icon_file.close()
if color != None: 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) 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 = gtk.gdk.pixbuf_loader_new_with_mime_type('image/svg-xml')
loader.set_size(size, size) loader.set_size(size, size)
loader.write(data) loader.write(data)