diff options
| author | Christoph Berg <myon@debian.org> | 2022-12-04 22:15:32 +0100 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2022-12-04 22:15:32 +0100 |
| commit | fa73b3f50ec6ead52c3371a96f62bc6e666a9ee5 (patch) | |
| tree | 6971e745fdf2f4c6b81ded57e87d233840971d62 /widgets/displaytext.cpp | |
| parent | 4d2fac0dafe835b1ed479bebe136c3afe748ecf3 (diff) | |
New upstream version 2.6.0~rc5+repackupstream/2.6.0_rc5+repack
Diffstat (limited to 'widgets/displaytext.cpp')
| -rwxr-xr-x | widgets/displaytext.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
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
|
