mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-03-11 08:54:48 +00:00
Replace newlines with HTML line breaks in message dialogs
* Keeps readability of translation strings without losing line breaks due to forced rich text display
This commit is contained in:
parent
6760865487
commit
bd20cd2d1d
1 changed files with 3 additions and 1 deletions
|
|
@ -91,7 +91,9 @@ MessageBox::Button MessageBox::messageBox(QWidget* parent,
|
||||||
msgBox.setTextFormat(Qt::RichText);
|
msgBox.setTextFormat(Qt::RichText);
|
||||||
msgBox.setIcon(icon);
|
msgBox.setIcon(icon);
|
||||||
msgBox.setWindowTitle(title);
|
msgBox.setWindowTitle(title);
|
||||||
msgBox.setText(text);
|
// Replace newlines with HTML line breaks
|
||||||
|
auto fixedText = text;
|
||||||
|
msgBox.setText(fixedText.replace("\n", "<br>"));
|
||||||
|
|
||||||
if (m_overrideParent) {
|
if (m_overrideParent) {
|
||||||
// Force the creation of the QWindow, without this windowHandle() will return nullptr
|
// Force the creation of the QWindow, without this windowHandle() will return nullptr
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue