bec_widgets.utils.side_panel#

Classes#

ExampleApp

SidePanel

Side panel widget that can be placed on the left, right, top, or bottom of the main widget.

Module Contents#

class ExampleApp#

Bases: qtpy.QtWidgets.QMainWindow

add_side_menus()#
layout#
plot#
side_panel#
class SidePanel(parent=None, orientation: Literal['left', 'right', 'top', 'bottom'] = 'left', panel_max_width: int = 200, animation_duration: int = 200, animations_enabled: bool = True, show_toolbar: bool = True)#

Bases: qtpy.QtWidgets.QWidget

Side panel widget that can be placed on the left, right, top, or bottom of the main widget.

_init_ui()#

Initialize the UI elements.

add_menu(widget: qtpy.QtWidgets.QWidget, action_id: str | None = None, icon_name: str | None = None, tooltip: str | None = None, title: str | None = None) int#

Add a menu to the side panel.

Parameters:
  • widget (QWidget) – The widget to add to the panel.

  • action_id (str | None) – The ID of the action. Optional if no toolbar action is needed.

  • icon_name (str | None) – The name of the icon. Optional if no toolbar action is needed.

  • tooltip (str | None) – The tooltip for the action. Optional if no toolbar action is needed.

  • title (str | None) – The title of the panel.

Returns:

The index of the added panel, which can be used with show_panel() and switch_to().

Return type:

int

animation_duration()#

Get the duration of the animation.

animations_enabled()#

Get the status of the animations.

hide_panel()#

Hide the side panel with animation.

panel_height()#

Get the panel height.

panel_max_width()#

Get the maximum width of the panel.

panel_width()#

Get the panel width.

show_panel(idx: int)#

Show the side panel with animation and switch to idx.

switch_to(idx: int)#

Switch to the specified index without animation.

current_action: qtpy.QtGui.QAction | None = None#
current_index: int | None = None#
panel_visible = False#
switching_actions = False#