From 745f5982b4ca5e5723a6295425bb74d294e23f74 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 18 May 2006 17:11:09 -0400 Subject: [PATCH] Add icon to the bar --- sugar/browser/NotificationBar.py | 9 ++++++++- sugar/browser/browser.py | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/sugar/browser/NotificationBar.py b/sugar/browser/NotificationBar.py index 3c943b13..aa6aca4e 100644 --- a/sugar/browser/NotificationBar.py +++ b/sugar/browser/NotificationBar.py @@ -11,11 +11,14 @@ class NotificationBar(gtk.HBox): } def __init__(self): - gtk.HBox.__init__(self) + gtk.HBox.__init__(self, False, 12) self.set_name("notif bar") self.set_border_width(3) + self._icon = gtk.Image() + self.pack_start(self._icon, False) + self._text_label = gtk.Label() self._text_label.set_alignment(0.0, 0.5) self.pack_start(self._text_label) @@ -40,6 +43,10 @@ class NotificationBar(gtk.HBox): ctx.stroke() return False + + def set_icon(self, icon_name): + self._icon.set_from_icon_name(icon_name, gtk.ICON_SIZE_BUTTON) + self._icon.show() def set_text(self, text): self._text_label.set_markup(text) diff --git a/sugar/browser/browser.py b/sugar/browser/browser.py index ae5780b4..f5cb224c 100755 --- a/sugar/browser/browser.py +++ b/sugar/browser/browser.py @@ -192,8 +192,9 @@ class BrowserActivity(activity.Activity): def set_mode(self, mode): self._mode = mode if mode == BrowserActivity.LEADING: - self._notif_bar.set_text("Share this page with the group.") - self._notif_bar.set_action("set_shared_location", "Share") + self._notif_bar.set_text('Share this page with the group.') + self._notif_bar.set_action('set_shared_location', 'Share') + self._notif_bar.set_icon('stock_shared-by-me') self._notif_bar.show() def _setup_shared(self, uri):