feat: set urgency on linux notifications (#20152)

This commit is contained in:
Shelley Vohr 2019-09-18 22:35:20 -07:00 committed by GitHub
parent e510af77b2
commit ffe2182883
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 36 additions and 1 deletions

View file

@ -100,6 +100,16 @@ void LibnotifyNotification::Show(const NotificationOptions& options) {
nullptr);
}
NotifyUrgency urgency = NOTIFY_URGENCY_NORMAL;
if (options.urgency == base::ASCIIToUTF16("critical")) {
urgency = NOTIFY_URGENCY_CRITICAL;
} else if (options.urgency == base::ASCIIToUTF16("low")) {
urgency = NOTIFY_URGENCY_LOW;
}
// Set the urgency level of the notification.
libnotify_loader_.notify_notification_set_urgency(notification_, urgency);
if (!options.icon.drawsNothing()) {
GdkPixbuf* pixbuf = libgtkui::GdkPixbufFromSkBitmap(options.icon);
libnotify_loader_.notify_notification_set_image_from_pixbuf(notification_,