Skip to content

Commit

Permalink
Use symbolic in notifications
Browse files Browse the repository at this point in the history
Fixes issue #47
  • Loading branch information
aperezdc committed Mar 16, 2017
1 parent 652703d commit 10d7644
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion revolt/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,19 @@ def __on_load_changed(self, webview, event):
self.network_busy = True
self.application.statusicon.set_status("disconnected")

@cachedproperty
def _notification_icon(self):
icon_id = self.application.get_application_id() + "-symbolic"
return Gio.ThemedIcon.new(icon_id)

def __on_show_notification(self, webview, notification):
# TODO: Handle notification clicked, and so
if not self.has_toplevel_focus():
self.set_urgency_hint(True)
notif = Gio.Notification.new(notification.get_title())
notif.set_body(notification.get_body())
# TODO: Use the avatar of the contact, if available.
notif.set_icon(Gio.ThemedIcon.new("revolt"))
notif.set_icon(self._notification_icon)
notif.set_priority(Gio.NotificationPriority.HIGH)
# use title as notification id:
# allows to reuse one notification for the same conversation
Expand Down

0 comments on commit 10d7644

Please sign in to comment.