Spacebar closes dialogs without a scrollbar again.

This commit is contained in:
Mark de Wever 2009-01-01 15:50:21 +00:00
parent a274e8b591
commit 35003295be
6 changed files with 16 additions and 4 deletions

View file

@ -14,5 +14,6 @@ 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.
- Spacebar closes the dialogs without a scrollbar again.
***

View file

@ -3,6 +3,7 @@ Version 1.5.7+svn:
* 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).
* Spacebar closes the dialogs without a scrollbar again.
* Language and i18n:
* updated translations: Slovak
* Networking

View file

@ -5,6 +5,7 @@ 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.
* Spacebar closes the dialogs without a scrollbar again.
* Language and translations
* updated translations: Slovak.

View file

@ -350,8 +350,13 @@ private:
/** Function to do the real removal of the help popup. */
virtual void do_remove_help_popup() = 0;
/** Handler for the easy close functionallity. */
virtual void easy_close() = 0;
/**
* Handler for the easy close functionallity.
*
* @returns True if the easyclose action is performed,
* false otherwise.
*/
virtual bool easy_close() = 0;
};
} // namespace gui2

View file

@ -395,6 +395,8 @@ void twindow::key_press(tevent_handler& /*event_handler*/, bool& handled,
} else if(key == SDLK_ESCAPE) {
set_retval(CANCEL);
handled = true;
} else if(key == SDLK_SPACE) {
handled = easy_close();
}
#ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
if(key == SDLK_F12) {
@ -652,11 +654,13 @@ void twindow::do_show_help_popup(const tpoint& location, const t_string& help_po
help_popup_.set_visible(twidget::VISIBLE);
}
void twindow::easy_close()
bool twindow::easy_close()
{
if(does_easy_close()) {
set_retval(OK);
return true;
}
return false;
}
void twindow::draw(surface& /*surf*/, const bool /*force*/,

View file

@ -381,7 +381,7 @@ private:
{ help_popup_.set_visible(twidget::HIDDEN); }
/** Inherited from tevent_handler. */
void easy_close();
bool easy_close();
/** Inherited from tcontrol. */
const std::string& get_control_type() const