mail[Wesnoth-commits] r33252 - in /trunk: changelog src/gui/widgets/scrollbar_container.cpp src/gui/widgets/scrollbar_container.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by koraq on March 01, 2009 - 18:42:
Author: mordante
Date: Sun Mar  1 18:42:58 2009
New Revision: 33252

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33252&view=rev
Log:
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.

Modified:
    trunk/changelog
    trunk/src/gui/widgets/scrollbar_container.cpp
    trunk/src/gui/widgets/scrollbar_container.hpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=33252&r1=33251&r2=33252&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sun Mar  1 18:42:58 2009
@@ -26,6 +26,7 @@
    * 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

Modified: trunk/src/gui/widgets/scrollbar_container.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/scrollbar_container.cpp?rev=33252&r1=33251&r2=33252&view=diff
==============================================================================
--- trunk/src/gui/widgets/scrollbar_container.cpp (original)
+++ trunk/src/gui/widgets/scrollbar_container.cpp Sun Mar  1 18:42:58 2009
@@ -85,6 +85,8 @@
        , 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)
@@ -99,6 +101,12 @@
 {
        // 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 @@
 {
        if(vertical_scrollbar_mode_ != scrollbar_mode) {
                vertical_scrollbar_mode_ = scrollbar_mode;
+               initial_vertical_scrollbar_mode_ = scrollbar_mode;
                show_vertical_scrollbar();
        }
 }
@@ -491,6 +500,7 @@
 {
        if(horizontal_scrollbar_mode_ != scrollbar_mode) {
                horizontal_scrollbar_mode_ = scrollbar_mode;
+               initial_horizontal_scrollbar_mode_ = scrollbar_mode;
                show_horizontal_scrollbar();
        }
 }

Modified: trunk/src/gui/widgets/scrollbar_container.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/scrollbar_container.hpp?rev=33252&r1=33251&r2=33252&view=diff
==============================================================================
--- trunk/src/gui/widgets/scrollbar_container.hpp (original)
+++ trunk/src/gui/widgets/scrollbar_container.hpp Sun Mar  1 18:42:58 2009
@@ -340,6 +340,16 @@
                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_,




Related Messages


Powered by MHonArc, Updated Sun Mar 01 19:00:06 2009