Skip to content

Commit ca740d1

Browse files
committed
Add better option to disable hiding/showing contained elements of containers
1 parent 4031d46 commit ca740d1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pygame_gui/elements/ui_scrolling_container.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ def show(self, show_contents: bool = True):
524524
"""
525525
super().show()
526526

527+
self._root_container.show(show_contents=False)
527528
if self.vert_scroll_bar is not None:
528529
self.vert_scroll_bar.show()
529530
if self.horiz_scroll_bar is not None:
@@ -543,7 +544,7 @@ def hide(self, hide_contents: bool = True):
543544
"""
544545
if not self.visible:
545546
return
546-
547+
self._root_container.hide(hide_contents=False)
547548
if self.vert_scroll_bar is not None:
548549
self.vert_scroll_bar.hide()
549550
if self.horiz_scroll_bar is not None:

pygame_gui/elements/ui_window.py

+2
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ def show(self, show_contents: bool = True):
758758
:param show_contents: whether to also show the contents of the window. Defaults to True.
759759
"""
760760
super().show()
761+
self._window_root_container.show(show_contents=False)
761762
if self.title_bar is not None:
762763
self.title_bar.show()
763764
if self.close_window_button is not None:
@@ -776,6 +777,7 @@ def hide(self, hide_contents: bool = True):
776777
return
777778

778779
super().hide()
780+
self._window_root_container.hide(hide_contents=False)
779781
if self.title_bar is not None:
780782
self.title_bar.hide()
781783
if self.close_window_button is not None:

0 commit comments

Comments
 (0)