messageTray: Only take params in Notification constructor

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3173>
This commit is contained in:
Julian Sparber
2024-02-14 11:11:47 +01:00
committed by Florian Müllner
parent 251a5e9d20
commit d54219c098
13 changed files with 63 additions and 58 deletions

View File

@ -2087,12 +2087,12 @@ export const ScreenshotUI = GObject.registerClass({
title: _('Screenshot'),
iconName: 'screencast-recorded-symbolic',
});
const notification = new MessageTray.Notification(
const notification = new MessageTray.Notification({
source,
title,
// Translators: notification body when a screencast was recorded.
this._screencastPath ? _('Click here to view the video.') : ''
);
body: this._screencastPath ? _('Click here to view the video.') : '',
});
notification.setTransient(true);
if (this._screencastPath) {
@ -2329,14 +2329,15 @@ function _storeScreenshot(bytes, pixbuf) {
title: _('Screenshot'),
iconName: 'screenshot-recorded-symbolic',
});
const notification = new MessageTray.Notification(
const notification = new MessageTray.Notification({
source,
// Translators: notification title.
_('Screenshot captured'),
title: _('Screenshot captured'),
// Translators: notification body when a screenshot was captured.
_('You can paste the image from the clipboard.'),
{datetime: time, gicon: content}
);
body: _('You can paste the image from the clipboard.'),
datetime: time,
gicon: content,
});
if (!disableSaveToDisk) {
// Translators: button on the screenshot notification.