From f1b31697130101ab493a2f2907e3974f3cf1fa58 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 13 Sep 2019 15:13:40 +0300 Subject: [PATCH] CONTROVERSIAL: Detach ui_vp_message from ui_vp_chatbox to prevent it from being affected by the screenshake. ui_vp_message still sets position relative to the chat box for now (as doing otherwise would break a lot of themes). --- src/courtroom.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 04c2f86..2e174f2 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -86,7 +86,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() ui_vp_chatbox = new AOImage(this, ao_app); ui_vp_showname = new QLabel(ui_vp_chatbox); - ui_vp_message = new QTextEdit(ui_vp_chatbox); + ui_vp_message = new QTextEdit(this); ui_vp_message->setFrameStyle(QFrame::NoFrame); ui_vp_message->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); ui_vp_message->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); @@ -476,6 +476,8 @@ void Courtroom::set_widgets() set_size_and_pos(ui_vp_showname, "showname"); set_size_and_pos(ui_vp_message, "message"); + //We detached the text as parent from the chatbox so it doesn't get affected by the screenshake. +// 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); ui_vp_message->setStyleSheet("background-color: rgba(0, 0, 0, 0);" "color: white");