mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
unlockDialog: Handle embedded newlines in notifications
Detailed notifications are meant to be single line, just as unexpanded notification banners. So handle them the same way as in the message list, and replace embedded newlines by spaces. https://gitlab.gnome.org/GNOME/gnome-shell/issues/2463
This commit is contained in:
parent
ffb8bd5fa7
commit
61beccf733
1 changed files with 4 additions and 3 deletions
|
|
@ -115,7 +115,7 @@ var NotificationsBox = GObject.registerClass({
|
|||
box.add_child(textBox);
|
||||
|
||||
let title = new St.Label({
|
||||
text: source.title,
|
||||
text: source.title.replace(/\n/g, ' '),
|
||||
style_class: 'unlock-dialog-notification-label',
|
||||
});
|
||||
textBox.add(title);
|
||||
|
|
@ -129,9 +129,10 @@ var NotificationsBox = GObject.registerClass({
|
|||
|
||||
let body = '';
|
||||
if (n.bannerBodyText) {
|
||||
const bodyText = n.bannerBodyText.replace(/\n/g, ' ');
|
||||
body = n.bannerBodyMarkup
|
||||
? n.bannerBodyText
|
||||
: GLib.markup_escape_text(n.bannerBodyText, -1);
|
||||
? bodyText
|
||||
: GLib.markup_escape_text(bodyText, -1);
|
||||
}
|
||||
|
||||
let label = new St.Label({ style_class: 'unlock-dialog-notification-count-text' });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue