messageTray: Rename bannerBodyMarkup to useBodyMarkup in Notification object

I think the new name better reflects the effect of the property.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3173>
This commit is contained in:
Julian Sparber 2024-02-13 19:41:08 +01:00 committed by Florian Müllner
parent 00c292733d
commit d63013f075
3 changed files with 5 additions and 5 deletions

View File

@ -768,7 +768,7 @@ export const NotificationMessage = GObject.registerClass(
class NotificationMessage extends MessageList.Message { class NotificationMessage extends MessageList.Message {
_init(notification) { _init(notification) {
super._init(notification.source, notification.title, notification.body); super._init(notification.source, notification.title, notification.body);
this.setUseBodyMarkup(notification.bannerBodyMarkup); this.setUseBodyMarkup(notification.useBodyMarkup);
this.notification = notification; this.notification = notification;
this.datetime = notification.datetime; this.datetime = notification.datetime;
@ -805,7 +805,7 @@ class NotificationMessage extends MessageList.Message {
this.setIcon(this._getIcon()); this.setIcon(this._getIcon());
this.setTitle(n.title); this.setTitle(n.title);
this.setBody(n.body); this.setBody(n.body);
this.setUseBodyMarkup(n.bannerBodyMarkup); this.setUseBodyMarkup(n.useBodyMarkup);
} }
vfunc_clicked() { vfunc_clicked() {

View File

@ -409,7 +409,7 @@ export const Notification = GObject.registerClass({
this.privacyScope = PrivacyScope.USER; this.privacyScope = PrivacyScope.USER;
this.forFeedback = false; this.forFeedback = false;
this.body = null; this.body = null;
this.bannerBodyMarkup = false; this.useBodyMarkup = false;
this.sound = null; this.sound = null;
this._soundPlayed = false; this._soundPlayed = false;
this.actions = []; this.actions = [];
@ -442,7 +442,7 @@ export const Notification = GObject.registerClass({
this.title = title; this.title = title;
this.body = banner; this.body = banner;
this.bannerBodyMarkup = params.bannerMarkup; this.useBodyMarkup = params.bannerMarkup;
if (params.datetime) if (params.datetime)
this.datetime = params.datetime; this.datetime = params.datetime;

View File

@ -142,7 +142,7 @@ const NotificationsBox = GObject.registerClass({
let body = ''; let body = '';
if (n.body) { if (n.body) {
const bodyText = n.body.replace(/\n/g, ' '); const bodyText = n.body.replace(/\n/g, ' ');
body = n.bannerBodyMarkup body = n.useBodyMarkup
? bodyText ? bodyText
: GLib.markup_escape_text(bodyText, -1); : GLib.markup_escape_text(bodyText, -1);
} }