This fixes the appearance of both icons and titles of activity bundles
in the Journal.  The icons are now rendered as gray outlines, matching
those in the activity list of Home.  The titles are now used directly,
eliminating the "bug" which caused " Activity" to be appended every
time a the title of one was edited.

- Eben
From b3a7b5cfc61207edbf2eb27f35bab68a01fea6eb Mon Sep 17 00:00:00 2001
From: Eben Eliason <[EMAIL PROTECTED]>
Date: Tue, 22 Apr 2008 21:00:23 -0400
Subject: [PATCH] Fix appearance of activity bundles

This renders activity bundle icons in gray, matching those
shown in the Home activity list.  It also fixes the title
formatting bug, which would repeatedly append " Activity"
to activity bundle titles when edited.
---
 collapsedentry.py |   12 +++++-------
 expandedentry.py  |   10 ++--------
 2 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/collapsedentry.py b/collapsedentry.py
index c99208a..6b257d3 100644
--- a/collapsedentry.py
+++ b/collapsedentry.py
@@ -323,21 +323,19 @@ class CollapsedEntry(hippo.CanvasBox):
         self._icon.props.file_name = misc.get_icon_name(jobject)
         if jobject.is_activity_bundle():
             self._icon.props.fill_color=style.COLOR_TRANSPARENT.get_svg()
-            self._icon.props.stroke_color=style.COLOR_BLACK.get_svg()
-            self._title.props.text = self._format_title() + _(' Activity')
-            self._title_entry.props.text = self._format_title() + _(' Activity')
+            self._icon.props.stroke_color=style.COLOR_BUTTON_GREY.get_svg()
         else:    
             if jobject.metadata.has_key('icon-color') and \
                    jobject.metadata['icon-color']:
                 self._icon.props.xo_color = XoColor( \
                     jobject.metadata['icon-color'])
             else:
-                self._icon.props.xo_color = None        
-            self._title.props.text = self._format_title()
-            self._title_entry.props.text = self._format_title()
+                self._icon.props.xo_color = None
 
+        title_text = jobject.metadata.get('title', _('Untitled'))
+        self._title.props.text = title_text
+        self._title_entry.props.text = title_text
         self._icon.set_palette(ObjectPalette(jobject))
-
         self._buddies_list.set_model(self._decode_buddies())
 
         if jobject.metadata.has_key('progress'):
diff --git a/expandedentry.py b/expandedentry.py
index 693a41c..9534c4d 100644
--- a/expandedentry.py
+++ b/expandedentry.py
@@ -160,7 +160,7 @@ class ExpandedEntry(hippo.CanvasBox):
 
         if self._jobject.is_activity_bundle():
             icon.props.fill_color=style.COLOR_TRANSPARENT.get_svg()
-            icon.props.stroke_color=style.COLOR_BLACK.get_svg()
+            icon.props.stroke_color=style.COLOR_BUTTON_GREY.get_svg()
         else:
             if self._jobject.metadata.has_key('icon-color') and \
                    self._jobject.metadata['icon-color']:
@@ -174,13 +174,7 @@ class ExpandedEntry(hippo.CanvasBox):
     def _create_title(self):
         title = CanvasEntry()
         title.set_background(style.COLOR_WHITE.get_html())
-
-        text = self._jobject.metadata.get('title', _('Untitled'))
-        if self._jobject.is_activity_bundle():
-            title.props.text = text + _(' Activity')
-        else:    
-            title.props.text = text
-            
+        title.props.text = self._jobject.metadata.get('title', _('Untitled'))
         title.props.widget.connect('focus-out-event',
                                    self._title_focus_out_event_cb)
         return title
-- 
1.5.3.3

_______________________________________________
Sugar mailing list
[email protected]
http://lists.laptop.org/listinfo/sugar

Reply via email to