Skip to content

status_bar

dev_tool.tui.components.status_bar

StatusBarComponent

A component for rendering the status bar.

The constructor for the StatusBarComponent class.

Parameters:

  • terminal (Terminal) –

    The blessed Terminal instance.

  • theme (Default) –

    The theme instance for styling.

  • state (StateManager) –

    The state manager instance.

Source code in dev_tool/tui/components/status_bar.py
def __init__(self, terminal: Terminal, theme: Default, state: StateManager) -> None:
    """
    The constructor for the StatusBarComponent class.

    :param terminal: The blessed Terminal instance.
    :param theme: The theme instance for styling.
    :param state: The state manager instance.
    """

    self.state = state
    self.terminal = terminal
    self.theme = theme

state = state instance-attribute

terminal = terminal instance-attribute

theme = theme instance-attribute

draw

A method that draws the status bar with navigation info.

Parameters:

  • output (list) –

    The list to append terminal output strings to.

Source code in dev_tool/tui/components/status_bar.py
def draw(self, output: list) -> None:
    """
    A method that draws the status bar with navigation info.

    :param output: The list to append terminal output strings to.
    """

    line = self.terminal.height - 1
    left = self._get_left_content()
    right = self._get_right_content()
    middle = self._get_middle_content()
    status = self._format_layout(left, middle, right)

    background = ' ' * self.terminal.width

    output.append(self.terminal.move(line, 0) + self.theme.status_bar(background))
    output.append(self.terminal.move(line, 0) + self.theme.status_bar(status))