Apply a scrollbar's default value to scroll containers (#9699)
authorDS <vorunbekannt75@web.de>
Sat, 18 Apr 2020 15:20:20 +0000 (17:20 +0200)
committerGitHub <noreply@github.com>
Sat, 18 Apr 2020 15:20:20 +0000 (17:20 +0200)
Fixes #9691.

games/minimal/mods/test/formspec.lua
src/gui/guiScrollContainer.h

index 53e92b243e48fc0b946fa5c723e210749af3698e..4ab4f2717236973ca7b693fdf98fb55c59f57234 100644 (file)
@@ -251,7 +251,7 @@ Number]
                        "box[1,22.5;4,1;#a00a]"..\r
                "scroll_container_end[]"..\r
                "scrollbaroptions[max=170]".. -- lowest seen pos is: 0.1*170+6=23 (factor*max+height)\r
-               "scrollbar[7.5,0;0.3,4;vertical;scrbar;0]"..\r
+               "scrollbar[7.5,0;0.3,4;vertical;scrbar;20]"..\r
                "scrollbar[8,0;0.3,4;vertical;scrbarhmmm;0]"..\r
                "dropdown[0,6;2;hmdrpdwnnn;apple,bulb;1]",\r
 }\r
index 9eaa880bf495c23a652b040385631fa1306d9cf2..a0306291e75d2448dbfde1719c0471d56ff8e65a 100644 (file)
@@ -38,7 +38,11 @@ public:
                        updateScrolling();
        }
 
-       inline void setScrollBar(GUIScrollBar *scrollbar) { m_scrollbar = scrollbar; }
+       inline void setScrollBar(GUIScrollBar *scrollbar)
+       {
+               m_scrollbar = scrollbar;
+               updateScrolling();
+       }
 
 private:
        enum OrientationEnum