diff --git a/src/courtroom.cpp b/src/courtroom.cpp index effef54..943a8f8 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -84,7 +84,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_showname->setAlignment(Qt::AlignHCenter); + ui_vp_showname->setAlignment(Qt::AlignLeft); ui_vp_chat_arrow = new AOMovie(ui_vp_chatbox, ao_app); ui_vp_chat_arrow->set_play_once(false); @@ -1873,7 +1873,7 @@ void Courtroom::handle_chatmessage_2() { ui_vp_chatbox->set_image("chatblank"); } - else // Aw yeah dude do some showname resizing magic + else // Aw yeah dude do some showname magic { if (!ui_vp_chatbox->set_image("chat")) ui_vp_chatbox->set_image("chatbox"); @@ -1913,6 +1913,19 @@ void Courtroom::handle_chatmessage_2() ->get_design_element("showname_extra_width", "courtroom_design.ini", customchar) .toInt(); + QString align = + ao_app + ->get_design_element("showname_align", "courtroom_design.ini", + customchar) + .toLower(); + if (align == "right") + ui_vp_showname->setAlignment(Qt::AlignRight); + else if (align == "center") + ui_vp_showname->setAlignment(Qt::AlignHCenter); + else if (align == "justify") + ui_vp_showname->setAlignment(Qt::AlignHCenter); + else + ui_vp_showname->setAlignment(Qt::AlignLeft); if (extra_width > 0) { if (fm_width > default_width.width && @@ -1934,6 +1947,10 @@ void Courtroom::handle_chatmessage_2() else ui_vp_showname->resize(default_width.width, ui_vp_showname->height()); } + else + { + ui_vp_showname->resize(default_width.width, ui_vp_showname->height()); + } } ui_vp_message->hide();