Fixed a closing bug in the new dialogs.

The old style dialogs get dismissed on a mouse down, the next mouse up
event was most of the time handled by the new dialog. The new dialog
issued an easy_close event which closed the dialog. Moved the handler in
the mouse_up code (which already ignores mouse up events without the
button being down). The effect was percieved as the new dialog not
showing up.
This commit is contained in:
Mark de Wever 2009-01-01 12:06:06 +00:00
parent dcc3d696a7
commit 2b394b1c97
4 changed files with 10 additions and 7 deletions

View file

@ -12,6 +12,7 @@ The release team should empty this file after each release.
***
Many improvements in the new dialog code:
- Fixed a glitch where a new dialog didn't show up after an old dialog.
***

View file

@ -1,6 +1,8 @@
Version 1.5.7+svn:
* Graphics:
* Fixed drawing glitches in the listboxes.
* Fixed a glitch which closed a new dialog on the mouse up event of the old
dialog (the effect is percieved as the new dialog not showing up).
* Language and i18n:
* updated translations: Slovak
* Networking

View file

@ -3,6 +3,8 @@ changes may be omitted). For a complete list of changes, see the main
changelog: http://svn.gna.org/viewcvs/*checkout*/wesnoth/trunk/changelog
Version 1.5.7+svn:
* Graphics:
* Fixed a glitch where a new dialog didn't show up after an old dialog.
* Language and translations
* updated translations: Slovak.

View file

@ -189,9 +189,9 @@ void tevent_handler::handle_event(const SDL_Event& event)
switch(event.button.button) {
/*
* All button clicks should trigger easy_close() unfortunately
* the scrollwheel also produceses click events, thus the
* function is moved to all cases.
* All button clicks should trigger easy_close() This is doen
* in the mouse_button_up function since that also evaluates
* the state of the mouse before handling the event.
*
* Note the engine makes sure easy close is disabled when a
* widget needs to process the click so calling it
@ -200,17 +200,14 @@ void tevent_handler::handle_event(const SDL_Event& event)
case SDL_BUTTON_LEFT :
DBG_G_E << "Event: Left button up.\n";
mouse_button_up(event, mouse_over, left_);
easy_close();
break;
case SDL_BUTTON_MIDDLE :
DBG_G_E << "Event: Middle button up.\n";
mouse_button_up(event, mouse_over, middle_);
easy_close();
break;
case SDL_BUTTON_RIGHT :
DBG_G_E << "Event: Right button up.\n";
mouse_button_up(event, mouse_over, right_);
easy_close();
break;
default:
// cast to avoid being printed as char.
@ -493,6 +490,7 @@ void tevent_handler::mouse_button_up(
button.focus = 0;
set_hover();
easy_close();
}
void tevent_handler::mouse_click(twidget* widget, tmouse_button& button)