Add icon to the bar
This commit is contained in:
parent
c87af3d782
commit
745f5982b4
@ -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)
|
||||
@ -41,6 +44,10 @@ class NotificationBar(gtk.HBox):
|
||||
|
||||
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)
|
||||
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user