Add icon to the bar

This commit is contained in:
Marco Pesenti Gritti 2006-05-18 17:11:09 -04:00
parent c87af3d782
commit 745f5982b4
2 changed files with 11 additions and 3 deletions

View File

@ -11,11 +11,14 @@ class NotificationBar(gtk.HBox):
} }
def __init__(self): def __init__(self):
gtk.HBox.__init__(self) gtk.HBox.__init__(self, False, 12)
self.set_name("notif bar") self.set_name("notif bar")
self.set_border_width(3) self.set_border_width(3)
self._icon = gtk.Image()
self.pack_start(self._icon, False)
self._text_label = gtk.Label() self._text_label = gtk.Label()
self._text_label.set_alignment(0.0, 0.5) self._text_label.set_alignment(0.0, 0.5)
self.pack_start(self._text_label) self.pack_start(self._text_label)
@ -41,6 +44,10 @@ class NotificationBar(gtk.HBox):
return False 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): def set_text(self, text):
self._text_label.set_markup(text) self._text_label.set_markup(text)

View File

@ -192,8 +192,9 @@ class BrowserActivity(activity.Activity):
def set_mode(self, mode): def set_mode(self, mode):
self._mode = mode self._mode = mode
if mode == BrowserActivity.LEADING: if mode == BrowserActivity.LEADING:
self._notif_bar.set_text("Share this page with the group.") self._notif_bar.set_text('Share this page with the group.')
self._notif_bar.set_action("set_shared_location", "Share") self._notif_bar.set_action('set_shared_location', 'Share')
self._notif_bar.set_icon('stock_shared-by-me')
self._notif_bar.show() self._notif_bar.show()
def _setup_shared(self, uri): def _setup_shared(self, uri):