aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorin1tiate <32779090+in1tiate@users.noreply.github.com>2024-06-18 12:38:13 -0500
committerGitHub <noreply@github.com>2024-06-18 19:38:13 +0200
commit6c6e46f6fc9d488d9c0a619de7ae8e19541e4cf7 (patch)
tree4ee2168f74f6d7f6cf4e66c7355f832d7bf56153 /src
parent7897033205e7100c5fdcb0d9d17629850fa60266 (diff)
Explicitly set sane line spacing (#981)
* Explicitly set sane line spacing * Update naming to reflect setting set by Format + fix memory leak Address memory leak --------- Co-authored-by: Salanto <62221668+Salanto@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/courtroom.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index c2c34219..42db26fe 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -3299,6 +3299,14 @@ void Courtroom::initialize_chatbox()
ui_vp_message->move(ui_vp_message->x() + ui_vp_chatbox->x(), ui_vp_message->y() + ui_vp_chatbox->y());
ui_vp_message->setTextInteractionFlags(Qt::NoTextInteraction);
+ // For some reason, line spacing is done incorrectly unless we set it here.
+ QTextCursor textCursor = ui_vp_message->textCursor();
+ QTextBlockFormat linespacingFormat = QTextBlockFormat();
+ textCursor.clearSelection();
+ textCursor.select(QTextCursor::Document);
+ linespacingFormat.setLineHeight(100, QTextBlockFormat::ProportionalHeight);
+ textCursor.setBlockFormat(linespacingFormat);
+
if (ui_vp_showname->text().trimmed().isEmpty()) // Whitespace showname
{
ui_vp_chatbox->setImage("chatblank", p_misc);