bec_widgets.applications.navigation_centre.side_bar_components#

Classes#

DarkModeNavItem

Bottom action item that toggles app theme and updates its icon/text.

NavigationItem

A nav tile with an icon + labels and an optional expandable body.

SectionHeader

A section header with a label and a horizontal line below.

SideBarSeparator

A horizontal line separator for use in SideBar.

Functions#

Module Contents#

class DarkModeNavItem(parent=None, *, id: str = 'dark_mode', anim_duration: int = ANIMATION_DURATION)#

Bases: NavigationItem

Bottom action item that toggles app theme and updates its icon/text.

_qapp_dark_enabled() bool#
_sync_from_qapp_theme()#
refresh_theme()#
toggle_theme()#

Toggle application theme and update icon/text.

class NavigationItem(parent=None, *, title: str, icon_name: str, mini_text: str | None = None, toggleable: bool = True, exclusive: bool = True, anim_duration: int = ANIMATION_DURATION)#

Bases: qtpy.QtWidgets.QWidget

A nav tile with an icon + labels and an optional expandable body. Provides animations for collapsed/expanded sidebar states via build_animations()/setup_animations(), similar to SectionHeader.

_emit_activated()#
build_animations() list[qtpy.QtCore.QPropertyAnimation]#

Build and return animations for expanding/collapsing the sidebar.

Returns:

List of animations.

Return type:

list[QPropertyAnimation]

exclusive() bool#

Whether the item is exclusive in its toggle group.

Returns:

True if exclusive, False otherwise.

Return type:

bool

is_active() bool#

Return whether the item is currently active/selected.

mousePressEvent(event)#
refresh_theme()#
set_active(active: bool)#

Set the active/selected state of the item.

Parameters:

active (bool) – True to set active, False to deactivate.

set_visible(visible: bool)#

Set visibility of the title label.

setup_animations(expanded: bool)#

Setup animations for expanding/collapsing the sidebar.

Parameters:

expanded (bool) – True if the sidebar is expanded, False if collapsed.

toggleable() bool#

Whether the item is toggleable (like a button) or not (like an action).

Returns:

True if toggleable, False otherwise.

Return type:

bool

toggled() bool#

Whether the item is currently toggled/selected.

Returns:

True if toggled, False otherwise.

Return type:

bool

activated#
icon_btn#
icon_size_anim#
mini_icon#
mini_lbl#
reveal_mini_lbl#
reveal_title_lbl#
title_lbl#
class SectionHeader(parent=None, text: str = None, anim_duration: int = ANIMATION_DURATION)#

Bases: qtpy.QtWidgets.QWidget

A section header with a label and a horizontal line below.

build_animations() list[qtpy.QtCore.QPropertyAnimation]#

Build and return animations for expanding/collapsing the sidebar.

Returns:

List of animations.

Return type:

list[QPropertyAnimation]

setup_animations(expanded: bool)#

Setup animations for expanding/collapsing the sidebar.

Parameters:

expanded (bool) – True if the sidebar is expanded, False if collapsed.

animations#
lbl#
line#
class SideBarSeparator(parent=None)#

Bases: qtpy.QtWidgets.QFrame

A horizontal line separator for use in SideBar.

get_fg()#
get_on_primary()#