Terminal: Fix "nano" titlebar

QTextLayout ignores trailing spaces, and does not draw their
background color. Converting them to Nbsp fixes this.

Change-Id: I19a363bcb4792c613eb9c59f7caaa40fa631b937
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-03-03 16:40:11 +01:00
committed by Cristian Adam
parent af520667ca
commit 7fc674b566
2 changed files with 4 additions and 0 deletions

View File

@@ -101,6 +101,8 @@ void createTextLayout(QTextLayout &textLayout,
if (cell->chars[0] != 0xFFFFFFFF) { if (cell->chars[0] != 0xFFFFFFFF) {
QString ch = QString::fromUcs4(cell->chars); QString ch = QString::fromUcs4(cell->chars);
if (ch == ' ')
ch = QChar::Nbsp;
if (ch.size() > 0) { if (ch.size() > 0) {
layoutText += ch; layoutText += ch;
} else { } else {

View File

@@ -390,6 +390,8 @@ void TerminalWidget::copyToClipboard() const
.trimmed()); .trimmed());
} }
selectedText.replace(QChar::Nbsp, QChar::Space);
setClipboardAndSelection(selectedText); setClipboardAndSelection(selectedText);
} }
} }