Avoid calling the change callback twice.

This caused issues with the gamestate inspector in combination with the
provious commit. Since the code only seems to be required for the
experimental MP lobby it has been disabled.
This commit is contained in:
Mark de Wever 2014-06-09 11:03:32 +02:00
parent 1be5aebc28
commit b57f9c81f3
2 changed files with 18 additions and 0 deletions

View file

@ -56,6 +56,7 @@ Version 1.13.0-dev:
* Remove 'allow_new_game=no' entries from random map new game list
* Fixed bug #22095: An assertion failure in the gamestate inspector.
* Changed: A listbox can now update its size when rows are added.
* Changed: Avoid listboxes to handle mouse clicks twice.
* WML engine:
* Added customizable recall costs for unit types and individual units,
using the new recall_cost attribute in [unit_type] and [unit].

View file

@ -265,9 +265,26 @@ ttoggle_panel::signal_handler_pre_left_button_click(const event::tevent event)
DBG_GUI_E << get_control_type() << "[" << id() << "]: " << event << ".\n";
set_value(true);
#if 0
/*
* Disabled since it causes issues with gamestate inspector (bug #22095).
* It was added in b84f2ebff0b53c7e4194da315c43f62a08494c52 for the lobby,
* since that code is still experimental, prefer to fix a real issue caused
* by it.
*
* The issue is that the gui2::tlistbox::add_row code was changed to
* increase the content size. Before the list was shown the list was
* cleared. The clear operation did not reduce the size (since the widgets
* were not shown yet). The add operation afterwards again reserved the
* space causing the size of the listbox to be twice the required space.
*
* 2014.06.09 -- Mordante
*/
if(callback_state_change_) {
callback_state_change_(*this);
}
#endif
}
void ttoggle_panel::signal_handler_left_button_click(const event::tevent event,