Properly reset the scrollbar mode when resizing.

Before after the first sizing and the scrollbar not needed it was set to
a disabled mode, which meant the scrollbar would no longer be shown when
needed after resizing. Fixes bug #13018.

Another unrelated bug was discovered while fixing this issue, the side
panel gets wrongly overdrawn. This due to the undrawing, which will be
fixed post 1.6.
This commit is contained in:
Mark de Wever 2009-03-01 17:42:58 +00:00
parent 1b2277c6d2
commit 75b8f16e27
3 changed files with 21 additions and 0 deletions

View file

@ -26,6 +26,7 @@ Version 1.5.11+svn:
* Fixed bug #13029: Problem with mouse-over unit identification in replays
* Added experimental campaign selection dialog (Only available when
starting with --new-widgets.)
* Properly reset the scrollbar mode when resizing (bug #13018)
* WML Engine:
* Fix incorrect or doubled "sighted" events when delaying shroud update
* Fix sometimes doubled "select" events

View file

@ -85,6 +85,8 @@ tscrollbar_container::tscrollbar_container(const unsigned canvas_count)
, state_(ENABLED)
, vertical_scrollbar_mode_(SHOW_WHEN_NEEDED)
, horizontal_scrollbar_mode_(SHOW_WHEN_NEEDED)
, initial_vertical_scrollbar_mode_(SHOW_WHEN_NEEDED)
, initial_horizontal_scrollbar_mode_(SHOW_WHEN_NEEDED)
, vertical_scrollbar_grid_(NULL)
, horizontal_scrollbar_grid_(NULL)
, vertical_scrollbar_(NULL)
@ -100,6 +102,12 @@ void tscrollbar_container::layout_init()
// Inherited.
tcontainer_::layout_init();
vertical_scrollbar_mode_ = initial_vertical_scrollbar_mode_;
horizontal_scrollbar_mode_ = initial_horizontal_scrollbar_mode_;
show_vertical_scrollbar();
show_horizontal_scrollbar();
assert(content_grid_);
content_grid_->layout_init();
}
@ -482,6 +490,7 @@ void tscrollbar_container::
{
if(vertical_scrollbar_mode_ != scrollbar_mode) {
vertical_scrollbar_mode_ = scrollbar_mode;
initial_vertical_scrollbar_mode_ = scrollbar_mode;
show_vertical_scrollbar();
}
}
@ -491,6 +500,7 @@ void tscrollbar_container::
{
if(horizontal_scrollbar_mode_ != scrollbar_mode) {
horizontal_scrollbar_mode_ = scrollbar_mode;
initial_horizontal_scrollbar_mode_ = scrollbar_mode;
show_horizontal_scrollbar();
}
}

View file

@ -340,6 +340,16 @@ private:
vertical_scrollbar_mode_,
horizontal_scrollbar_mode_;
/**
* The initial mode of how to show the scrollbar.
*
* If layout_init is called a second time the scrollbar_mode should be
* reset to its 'initial' mode. This is the last mode the user set.
*/
tscrollbar_mode
initial_vertical_scrollbar_mode_,
initial_horizontal_scrollbar_mode_;
/** These are valid after finalize_setup(). */
tgrid
*vertical_scrollbar_grid_,