Increasing the size of the MP lobby works properly.

Reducing the size especially in the size where scrollbars are needed
still seems to result in crashes.

(Partly fixes bug #14759.)
This commit is contained in:
Mark de Wever 2009-11-14 16:09:53 +00:00
parent 678bd9ac52
commit c97ea4549e
3 changed files with 47 additions and 2 deletions

View file

@ -10,6 +10,7 @@ Version 1.7.8+svn:
* Updated music tracks: Legends of the North, Breaking the Chains
* User interface:
* Show selected item after a listbox resize (bug #13995)
* Increasing the size of the MP lobby works properly (bug #14759)
Version 1.7.8-beta1:
* Campaigns:

View file

@ -7,6 +7,8 @@ Version 1.7.8+svn:
* Updated translations: Czech, French, German, Latin, Polish,
Portuguese (Brazil).
* User interface:
* Increasing the size of the MP lobby works properly.
Version 1.7.8-beta1:
* Campaigns:
@ -22,7 +24,7 @@ Version 1.7.8-beta1:
* Updated translations: Czech, Dutch, Finnish, German, Hungarian, Italian,
Latin, Lithuanian, Portuguese (Brazil), Russian.
* User interface:
* User interface:
* Fixed storyscreen buttons occasionally disappearing.
* Improved display order of unit healing. (patch #1343)
* Switched to the new MP lobby.

View file

@ -18,6 +18,7 @@
#include "gui/dialogs/field.hpp"
#include "gui/dialogs/helper.hpp"
#include "gui/auxiliary/log.hpp"
#include "gui/widgets/button.hpp"
#include "gui/widgets/image.hpp"
#include "gui/widgets/label.hpp"
@ -314,9 +315,50 @@ tlobby_main::~tlobby_main()
{
}
static void signal_handler_sdl_video_resize(
const event::tevent event
, bool& handled
, bool& halt
, const tpoint& new_size
, CVideo& video)
{
DBG_GUI_E << __func__ << ": " << event << ".\n";
if(new_size.x < preferences::min_allowed_width()
|| new_size.y < preferences::min_allowed_height()) {
DBG_GUI_E << __func__ << ": resize aborted, too small.\n";
handled = true;
halt = true;
return;
}
if(new_size.x == static_cast<int>(settings::screen_width)
&& new_size.y == static_cast<int>(settings::screen_height)) {
DBG_GUI_E << __func__ << ": resize not needed.\n";
handled = true;
return;
}
if(!preferences::set_resolution(video , new_size.x, new_size.y)) {
LOG_GUI_E << __func__
<< ": resize aborted, resize failed.\n";
}
}
twindow* tlobby_main::build_window(CVideo& video)
{
return build(video, get_id(LOBBY_MAIN));
twindow* window = build(video, get_id(LOBBY_MAIN));
assert(window);
/** @todo Remove this code once the resizing in twindow is finished. */
window->connect_signal<event::SDL_VIDEO_RESIZE>(
boost::bind(&signal_handler_sdl_video_resize
, _2, _3, _4, _5, boost::ref(video))
, event::tdispatcher::front_child);
return window;
}
namespace {