bec_widgets.applications.navigation_centre.side_bar#

Classes#

Module Contents#

class SideBar(parent=None, title: str = 'Control Panel', collapsed_width: int = 56, expanded_width: int = 250, anim_duration: int = ANIMATION_DURATION)#

Bases: qtpy.QtWidgets.QScrollArea

_insert_nav_item(item: qtpy.QtWidgets.QWidget, *, from_top: bool = True, position: int | None = None)#
_on_anim_finished()#
_on_theme_changed(theme_name: str)#
activate_item(target_id: str, *, emit_signal: bool = True)#
add_dark_mode_item(id: str = 'dark_mode', position: int | None = None) bec_widgets.applications.navigation_centre.side_bar_components.DarkModeNavItem#

Add a dark mode toggle item to the side bar.

Parameters:
  • id (str) – Unique ID for the dark mode item.

  • position (int, optional) – Position to insert the dark mode item.

Returns:

The created dark mode navigation item.

Return type:

DarkModeNavItem

add_item(icon: str, title: str, id: str, mini_text: str | None = None, position: int | None = None, *, from_top: bool = True, toggleable: bool = True, exclusive: bool = True) bec_widgets.applications.navigation_centre.side_bar_components.NavigationItem#

Add a navigation item to the side bar.

Parameters:
  • icon (str) – Icon name for the nav item.

  • title (str) – Title for the nav item.

  • id (str) – Unique ID for the nav item.

  • mini_text (str, optional) – Short text for the nav item when sidebar is collapsed.

  • position (int, optional) – Position to insert the nav item.

  • from_top (bool, optional) – Whether to count position from the top or bottom.

  • toggleable (bool, optional) – Whether the nav item is toggleable.

  • exclusive (bool, optional) – Whether the nav item is exclusive.

Returns:

The created navigation item.

Return type:

NavigationItem

add_section(title: str, id: str, position: int | None = None) bec_widgets.applications.navigation_centre.side_bar_components.SectionHeader#

Add a section header to the side bar.

Parameters:
  • title (str) – The title of the section.

  • id (str) – Unique ID for the section.

  • position (int, optional) – Position to insert the section header.

Returns:

The created section header.

Return type:

SectionHeader

add_separator(*, from_top: bool = True, position: int | None = None) bec_widgets.applications.navigation_centre.side_bar_components.SideBarSeparator#

Add a separator line to the side bar. Separators are treated like regular items; you can place multiple separators anywhere using from_top and position.

bar_width() int#

Get the current width of the side bar.

Returns:

The current width of the side bar.

Return type:

int

is_expanded() bool#

Check if the side bar is expanded.

Returns:

True if the side bar is expanded, False otherwise.

Return type:

bool

on_expand()#

Toggle the expansion state of the side bar.

components#
content#
content_layout#
group#
title_anim#
title_fx#
title_label#
toggle#
toggle_row#
toggle_row_layout#
toggled#
view_selected#
width_anim#