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).

This commit is contained in:
Crystalwarrior 2019-09-13 15:13:40 +03:00
parent 040898feff
commit f1b3169713

View File

@ -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");