mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-02 03:26:14 -04: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
f62ea95499
commit
e2cf37a91f
1 changed files with 3 additions and 1 deletions
|
@ -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", "<br>"));
|
||||
|
||||
if (m_overrideParent) {
|
||||
// Force the creation of the QWindow, without this windowHandle() will return nullptr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue