From fa73b3f50ec6ead52c3371a96f62bc6e666a9ee5 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Sun, 4 Dec 2022 22:15:32 +0100 Subject: New upstream version 2.6.0~rc5+repack --- widgets/displaytext.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'widgets/displaytext.cpp') diff --git a/widgets/displaytext.cpp b/widgets/displaytext.cpp index 8d8ccb38..2a75c2da 100755 --- a/widgets/displaytext.cpp +++ b/widgets/displaytext.cpp @@ -86,7 +86,7 @@ void DisplayText::mouseDoubleClickEvent(QMouseEvent *e) void DisplayText::insertLineSpacer(QString const& line) { - appendText (line, "#d3d3d3"); + insertText (line, "#d3d3d3"); } namespace @@ -123,11 +123,11 @@ namespace } } -void DisplayText::appendText(QString const& text, QColor bg, QColor fg - , QString const& call1, QString const& call2) +void DisplayText::insertText(QString const& text, QColor bg, QColor fg + , QString const& call1, QString const& call2, QTextCursor::MoveOperation location) { auto cursor = textCursor (); - cursor.movePosition (QTextCursor::End); + cursor.movePosition (location); auto block_format = cursor.blockFormat (); auto format = cursor.blockCharFormat (); format.setFont (char_font_); @@ -484,7 +484,7 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con } } - appendText (message.trimmed (), bg, fg, decodedText.call (), dxCall); + insertText (message.trimmed (), bg, fg, decodedText.call (), dxCall); } @@ -516,18 +516,19 @@ void DisplayText::displayTransmittedText(QString text, QString modeTx, qint32 tx QColor fg; highlight_types types {Highlight::Tx}; set_colours (m_config, &bg, &fg, types); - appendText (t, bg, fg); + insertText (t, bg, fg); } void DisplayText::displayQSY(QString text) { QString t = QDateTime::currentDateTimeUtc().toString("hhmmss") + " " + text; - appendText (t, "hotpink"); + insertText (t, "hotpink"); } -void DisplayText::displayFoxToBeCalled(QString t, QColor bg, QColor fg) +void DisplayText::displayHoundToBeCalled(QString t, bool bAtTop, QColor bg, QColor fg) { - appendText (t, bg, fg); + if (bAtTop) t = t + "\n"; // need a newline when insertion at top + insertText(t, bg, fg, "", "", bAtTop ? QTextCursor::Start : QTextCursor::End); } namespace -- cgit v1.2.3