diff options
| author | stonedDiscord <stoned@derpymail.org> | 2017-03-18 17:54:28 +0100 |
|---|---|---|
| committer | stonedDiscord <stoned@derpymail.org> | 2017-03-18 17:54:34 +0100 |
| commit | 5ddde2bf9c4c8babba1dfea8c7de76b4c25f77f0 (patch) | |
| tree | 22e6da61507ea5a2d0cf1c07e84c728907960eca | |
| parent | 1fe3f25a256703f798b6f1fd69a9b7b37476f2df (diff) | |
made lobby resizeable from design ini
| -rw-r--r-- | lobby.cpp | 20 | ||||
| -rw-r--r-- | lobby.h | 4 |
2 files changed, 21 insertions, 3 deletions
@@ -59,7 +59,25 @@ void Lobby::set_widgets() { ao_app->set_user_theme(); - ui_background->resize(m_lobby_width, m_lobby_height); + QString filename = "lobby_design.ini"; + + pos_size_type f_lobby = ao_app->get_element_dimensions("lobby", filename); + + if (f_lobby.width < 0 || f_lobby.height < 0) + { + qDebug() << "W: did not find courtroom width or height in " << filename; + + this->resize(517, 666); + } + else + { + m_lobby_width = f_lobby.width; + m_lobby_height = f_lobby.height; + + this->setFixedSize(f_lobby.width, f_lobby.height); + } + + set_size_and_pos(ui_background, "lobby"); ui_background->set_image("lobbybackground.png"); set_size_and_pos(ui_public_servers, "public_servers"); @@ -42,8 +42,8 @@ public: private: AOApplication *ao_app; - const int m_lobby_width = 517; - const int m_lobby_height = 666; + int m_lobby_width = 517; + int m_lobby_height = 666; AOImage *ui_background; |
