MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / ToggleContent

Method ToggleContent

gui/toggle_panel.py:122–143  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

120 self.parent.Fit()
121
122 def ToggleContent(self, event):
123 # self.Freeze()
124
125 if self._toggled:
126 # If we are expanded, save previous size and collapse by setting
127 # content height to 0
128 self.content_min_size = self.content_panel.GetSize()
129 self.content_panel.SetMinSize((self.content_min_size[0], 0))
130 self.header_arrow.SetLabel("\u25b6")
131 else:
132 # If we are collapsed, set content size to previously saved value
133 self.content_panel.SetMinSize(self.content_min_size)
134 self.header_arrow.SetLabel("\u25bc")
135
136 self._toggled = not self._toggled
137
138 # self.Thaw()
139
140 if self.force_layout:
141 self.parent.Layout()
142 else:
143 self.OnStateChange(self.GetBestSize())

Callers

nothing calls this directly

Calls 3

OnStateChangeMethod · 0.95
SetLabelMethod · 0.80
GetSizeMethod · 0.45

Tested by

no test coverage detected