Skip to content

Commit

Permalink
Add better option to disable hiding/showing contained elements of con…
Browse files Browse the repository at this point in the history
…tainers
  • Loading branch information
MyreMylar committed Nov 3, 2024
1 parent 4031d46 commit ca740d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pygame_gui/elements/ui_scrolling_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ def show(self, show_contents: bool = True):
"""
super().show()

self._root_container.show(show_contents=False)
if self.vert_scroll_bar is not None:
self.vert_scroll_bar.show()
if self.horiz_scroll_bar is not None:
Expand All @@ -543,7 +544,7 @@ def hide(self, hide_contents: bool = True):
"""
if not self.visible:
return

self._root_container.hide(hide_contents=False)
if self.vert_scroll_bar is not None:
self.vert_scroll_bar.hide()
if self.horiz_scroll_bar is not None:
Expand Down
2 changes: 2 additions & 0 deletions pygame_gui/elements/ui_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ def show(self, show_contents: bool = True):
:param show_contents: whether to also show the contents of the window. Defaults to True.
"""
super().show()
self._window_root_container.show(show_contents=False)
if self.title_bar is not None:
self.title_bar.show()
if self.close_window_button is not None:
Expand All @@ -776,6 +777,7 @@ def hide(self, hide_contents: bool = True):
return

super().hide()
self._window_root_container.hide(hide_contents=False)
if self.title_bar is not None:
self.title_bar.hide()
if self.close_window_button is not None:
Expand Down

0 comments on commit ca740d1

Please sign in to comment.