messageTray: Allow settings gobject properties of Source on creation
This also makes the `icon` property of `Source` writable so that it can be set during creation instead of overriding the getter of the icon property. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3103>
This commit is contained in:

committed by
Marge Bot

parent
c63d67c9af
commit
932ccac1c2
@ -609,10 +609,8 @@ export const Source = GObject.registerClass({
|
||||
'notification-show': {param_types: [Notification.$gtype]},
|
||||
},
|
||||
}, class Source extends GObject.Object {
|
||||
_init(title, iconName) {
|
||||
super._init({title});
|
||||
|
||||
this.icon = new Gio.ThemedIcon({name: iconName});
|
||||
constructor(params) {
|
||||
super(params);
|
||||
|
||||
this.notifications = [];
|
||||
|
||||
@ -655,14 +653,6 @@ export const Source = GObject.registerClass({
|
||||
: PrivacyScope.USER;
|
||||
}
|
||||
|
||||
setTitle(newTitle) {
|
||||
if (this.title === newTitle)
|
||||
return;
|
||||
|
||||
this.title = newTitle;
|
||||
this.notify('title');
|
||||
}
|
||||
|
||||
createBanner(notification) {
|
||||
return new NotificationBanner(notification);
|
||||
}
|
||||
@ -1349,8 +1339,11 @@ export const MessageTray = GObject.registerClass({
|
||||
|
||||
export const SystemNotificationSource = GObject.registerClass(
|
||||
class SystemNotificationSource extends Source {
|
||||
_init() {
|
||||
super._init(_('System Information'), 'dialog-information-symbolic');
|
||||
constructor() {
|
||||
super({
|
||||
title: _('System Information'),
|
||||
iconName: 'dialog-information-symbolic',
|
||||
});
|
||||
}
|
||||
|
||||
open() {
|
||||
|
Reference in New Issue
Block a user