From bd20cd2d1dfb57992337d2e351c77ee41b8ea2cc Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Sun, 18 May 2025 10:10:57 -0400 Subject: [PATCH] Replace newlines with HTML line breaks in message dialogs * Keeps readability of translation strings without losing line breaks due to forced rich text display --- src/gui/MessageBox.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/MessageBox.cpp b/src/gui/MessageBox.cpp index 94a4107bd..87898ff5c 100644 --- a/src/gui/MessageBox.cpp +++ b/src/gui/MessageBox.cpp @@ -91,7 +91,9 @@ MessageBox::Button MessageBox::messageBox(QWidget* parent, msgBox.setTextFormat(Qt::RichText); msgBox.setIcon(icon); msgBox.setWindowTitle(title); - msgBox.setText(text); + // Replace newlines with HTML line breaks + auto fixedText = text; + msgBox.setText(fixedText.replace("\n", "
")); if (m_overrideParent) { // Force the creation of the QWindow, without this windowHandle() will return nullptr