bec_widgets.utils.collapsible_panel_manager#
Classes#
Manager class to handle collapsible panels from a main widget using LayoutManagerWidget. |
|
Helper class to animate the size of a panel widget. |
|
Module Contents#
- class CollapsiblePanelManager(layout_manager: bec_widgets.widgets.containers.layout_manager.layout_manager.LayoutManagerWidget, reference_widget: qtpy.QtWidgets.QWidget, parent=None)#
Bases:
qtpy.QtCore.QObjectManager class to handle collapsible panels from a main widget using LayoutManagerWidget.
- _after_hide_reset(panel_widget: qtpy.QtWidgets.QWidget, direction: Literal['left', 'right', 'top', 'bottom'])#
Reset the panel widget after hiding it in ensure_max mode.
- Parameters:
panel_widget (QWidget) – The panel widget to reset.
direction (Literal["left", "right", "top", "bottom"]) – The direction of the panel.
- add_panel(direction: Literal['left', 'right', 'top', 'bottom'], panel_widget: qtpy.QtWidgets.QWidget, target_size: int | None = None, duration: int = 300)#
Add a panel widget to the layout manager.
- Parameters:
direction (Literal["left", "right", "top", "bottom"]) – Direction of the panel.
panel_widget (QWidget) – The panel widget to add.
target_size (int, optional) – The target size of the panel. Defaults to None.
duration (int) – The duration of the animation in milliseconds. Defaults to 300.
- toggle_panel(direction: Literal['left', 'right', 'top', 'bottom'], target_size: int | None = None, duration: int | None = None, easing_curve: qtpy.QtCore.QEasingCurve = QEasingCurve.InOutQuad, ensure_max: bool = False, scale: float | None = None, animation: bool = True)#
Toggle the specified panel.
- Parameters:
direction (Literal["left", "right", "top", "bottom"]) – Direction of the panel to toggle.
target_size (int, optional) – Override target size for this toggle.
duration (int, optional) – Override the animation duration.
easing_curve (QEasingCurve) – Animation easing curve.
ensure_max (bool) – If True, animate as a fixed-size panel.
scale (float, optional) – If provided, calculate target_size from main widget size.
animation (bool) – If False, no animation is performed; panel instantly toggles.
- animations#
- direction_settings#
- layout_manager#
- panels#
- reference_widget#
- class DimensionAnimator(panel_widget: qtpy.QtWidgets.QWidget, direction: str)#
Bases:
qtpy.QtCore.QObjectHelper class to animate the size of a panel widget.
- panel_height()#
Returns the current height of the panel widget.
- panel_width()#
Returns the current width of the panel widget.
- direction#
- panel_widget#