Skip to content

Commit

Permalink
Apply a scrollbar's default value to scroll containers (#9699)
Browse files Browse the repository at this point in the history
Fixes #9691.
  • Loading branch information
Desour committed Apr 18, 2020
1 parent 7b57d3f commit 241bf44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion games/minimal/mods/test/formspec.lua
Expand Up @@ -251,7 +251,7 @@ Number]
"box[1,22.5;4,1;#a00a]"..
"scroll_container_end[]"..
"scrollbaroptions[max=170]".. -- lowest seen pos is: 0.1*170+6=23 (factor*max+height)
"scrollbar[7.5,0;0.3,4;vertical;scrbar;0]"..
"scrollbar[7.5,0;0.3,4;vertical;scrbar;20]"..
"scrollbar[8,0;0.3,4;vertical;scrbarhmmm;0]"..
"dropdown[0,6;2;hmdrpdwnnn;apple,bulb;1]",
}
Expand Down
6 changes: 5 additions & 1 deletion src/gui/guiScrollContainer.h
Expand Up @@ -38,7 +38,11 @@ class GUIScrollContainer : public gui::IGUIElement
updateScrolling();
}

inline void setScrollBar(GUIScrollBar *scrollbar) { m_scrollbar = scrollbar; }
inline void setScrollBar(GUIScrollBar *scrollbar)
{
m_scrollbar = scrollbar;
updateScrolling();
}

private:
enum OrientationEnum
Expand Down

0 comments on commit 241bf44

Please sign in to comment.