Add showname alignment option for theme makers (#189)
* Add alignment options for shownames * Make shownames align to the left by default like before * Use this branch as an opportunity to fix showname not being resized according to misc/ folder courtroom_design.ini
This commit is contained in:
parent
bcbc48f9b0
commit
b2a5f517d9
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user