Make title screen rebuild its layout when the window is resized

This also restores one of the two reverted title screen tweaks.
This commit is contained in:
Celtic Minstrel 2016-08-25 15:58:17 -04:00
parent b1141fe457
commit 201abc9d7e
4 changed files with 13 additions and 0 deletions

View file

@ -75,6 +75,7 @@
id = "title_screen"
description = "Definition of the panel for the title screen"
{_GUI_RESOLUTION (window_width,window_height = 850, 650) 10 5 10 5}
{_GUI_RESOLUTION () 25 5 9 14 }
[/panel_definition]

View file

@ -362,6 +362,14 @@ void ttitle_screen::pre_show(twindow& window)
if(cores.size() <= 1) {
find_widget<tbutton>(&window, "cores", false).set_visible(twindow::tvisible::invisible);
}
window.connect_signal<event::SDL_VIDEO_RESIZE>(std::bind(&ttitle_screen::on_resize, this, std::ref(window)));
}
void ttitle_screen::on_resize(twindow& window)
{
window.set_retval(NOTHING);
window.close();
}
void ttitle_screen::update_tip(twindow& window, const bool previous)

View file

@ -91,6 +91,8 @@ private:
/** Inherited from tdialog. */
void pre_show(twindow& window);
void on_resize(twindow& window);
/** Holds the debug clock dialog. */
tpopup* debug_clock_;

View file

@ -854,6 +854,8 @@ static int do_gameloop(const std::vector<std::string>& args)
} else if(res == gui2::ttitle_screen::START_MAP_EDITOR) {
game->start_editor();
continue;
} else if(res == gui2::ttitle_screen::NOTHING) {
continue;
}
game->launch_game(should_reload);
}