messageTray: add SystemNotificationSource, moved from overview.js
Move the overview's "System Information" source here, so it can be used by non-overview code as well. https://bugzilla.gnome.org/show_bug.cgi?id=635089
This commit is contained in:
@ -18,6 +18,9 @@ const BoxPointer = imports.ui.boxpointer;
|
||||
const Params = imports.misc.params;
|
||||
const Utils = imports.misc.utils;
|
||||
|
||||
const Gettext = imports.gettext.domain('gnome-shell');
|
||||
const _ = Gettext.gettext;
|
||||
|
||||
const ANIMATION_TIME = 0.2;
|
||||
const NOTIFICATION_TIMEOUT = 4;
|
||||
const SUMMARY_TIMEOUT = 1;
|
||||
@ -1743,3 +1746,27 @@ MessageTray.prototype = {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function SystemNotificationSource() {
|
||||
this._init();
|
||||
}
|
||||
|
||||
SystemNotificationSource.prototype = {
|
||||
__proto__: Source.prototype,
|
||||
|
||||
_init: function() {
|
||||
Source.prototype._init.call(this, _("System Information"));
|
||||
|
||||
this._setSummaryIcon(this.createNotificationIcon());
|
||||
},
|
||||
|
||||
createNotificationIcon: function() {
|
||||
return new St.Icon({ icon_name: 'dialog-information',
|
||||
icon_type: St.IconType.SYMBOLIC,
|
||||
icon_size: this.ICON_SIZE });
|
||||
},
|
||||
|
||||
_notificationClicked: function() {
|
||||
this.destroy();
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user