SourceClass CollapsingState
from egui import CollapsingStateclass CollapsingState:This is a a building block for building collapsing regions.
It is used by CollapsingHeader and egui.Window, but can also be used on its own.
See CollapsingState.show_header for how to show a collapsing header with a custom header.
Methods§
Sourcedef id(self, /) -> Id§
Sourcedef is_open(self, /) -> bool§
Source@staticmethod
def load(ctx: Context, id: Id) -> CollapsingState |None§
Source@staticmethod
def load_with_default_open(ctx: Context, id: Id, default_open: bool) -> CollapsingState§
Sourcedef openness(self, /, ctx: Context) -> float§
0 for closed, 1 for open, with tweening
Sourcedef remove(self, /, ctx: Context) -> None§
Sourcedef set_open(self, /, open: bool) -> None§
Sourcedef show_body_indented(self, /, header_response: Response) -> Any§
Show body if we are open, with a nice animation between closed and open. Indent the body to show it belongs to the header.
Will also store the state.
Sourcedef show_body_unindented(self, /) -> Any§
Show body if we are open, with a nice animation between closed and open. Will also store the state.
Sourcedef show_header(self, /) -> Any§
Shows header and body (if expanded).
The header will start with the default button in a horizontal layout, followed by whatever you add.
Will also store the state.
Returns the response of the collapsing button, the custom header, and the custom body.
Sourcedef show_toggle_button(self, /, ui: Ui) -> Response§
Paint this CollapsingState's toggle button. Takes an IconPainter as the icon.