diff options
| author | in1tiate <32779090+in1tiate@users.noreply.github.com> | 2021-04-03 15:27:46 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-03 23:27:46 +0300 |
| commit | c82dc8dec7f41d91792de8ac8a69548a1266e66c (patch) | |
| tree | 8bb90da6fdeef36889e1577518812373f2faa8d8 /src | |
| parent | 350120d1b45a5c033d331cac89c328da69788a48 (diff) | |
move code outside if/else block (#518)
Diffstat (limited to 'src')
| -rw-r--r-- | src/courtroom.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 494d69f6..e5318b9c 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -2552,19 +2552,6 @@ void Courtroom::initialize_chatbox() if (!ui_vp_chatbox->set_image("chat", p_misc)) ui_vp_chatbox->set_image("chatbox", p_misc); - // This should probably be called only if any change from the last chat - // arrow was actually detected. - pos_size_type design_ini_result = ao_app->get_element_dimensions( - "chat_arrow", "courtroom_design.ini", p_misc); - if (design_ini_result.width < 0 || design_ini_result.height < 0) { - qDebug() << "W: could not find \"chat_arrow\" in courtroom_design.ini"; - ui_vp_chat_arrow->hide(); - } - else { - ui_vp_chat_arrow->move(design_ini_result.x + ui_vp_chatbox->x(), design_ini_result.y + ui_vp_chatbox->y()); - ui_vp_chat_arrow->combo_resize(design_ini_result.width, - design_ini_result.height); - } // Remember to set the showname font before the font metrics check. set_font(ui_vp_showname, "", "showname", customchar); @@ -2620,6 +2607,20 @@ void Courtroom::initialize_chatbox() } } + // This should probably be called only if any change from the last chat + // arrow was actually detected. + pos_size_type design_ini_result = ao_app->get_element_dimensions( + "chat_arrow", "courtroom_design.ini", p_misc); + if (design_ini_result.width < 0 || design_ini_result.height < 0) { + qDebug() << "W: could not find \"chat_arrow\" in courtroom_design.ini"; + ui_vp_chat_arrow->hide(); + } + else { + ui_vp_chat_arrow->move(design_ini_result.x + ui_vp_chatbox->x(), design_ini_result.y + ui_vp_chatbox->y()); + ui_vp_chat_arrow->combo_resize(design_ini_result.width, + design_ini_result.height); + } + QString font_name; QString chatfont = ao_app->get_chat_font(m_chatmessage[CHAR_NAME]); if (chatfont != "") |
