mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
messageTray: Support setting notification icon by name
Since we now display the source icon and an image for the notification, it's quite common to set an icon from a name. Therefore add a convenience property to do so. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3156>
This commit is contained in:
parent
4c5cb191d8
commit
daa8ea5ab2
1 changed files with 11 additions and 0 deletions
|
|
@ -431,6 +431,17 @@ export const Notification = GObject.registerClass({
|
|||
this.emit('updated', params.clear);
|
||||
}
|
||||
|
||||
get iconName() {
|
||||
if (this.gicon instanceof Gio.ThemedIcon)
|
||||
return this.gicon.iconName;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
set iconName(iconName) {
|
||||
this.gicon = new Gio.ThemedIcon({name: iconName});
|
||||
}
|
||||
|
||||
// addAction:
|
||||
// @label: the label for the action's button
|
||||
// @callback: the callback for the action
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue