pyqt_reactive.widgets.shared.button_panel
Reusable button panel with declarative configuration.
Extracted from AbstractManagerWidget to allow any widget to use the same button panel pattern without inheriting from the full manager.
Example
# Declarative configuration BUTTON_CONFIGS = [
(“Refresh”, “refresh”, “Refresh the display”), (“Toggle”, “toggle_layout”, “Toggle layout mode”),
]
# Create panel panel = ButtonPanel(
button_configs=self.BUTTON_CONFIGS, style_generator=self.style_generator, on_action=self.handle_button_action
)
Classes
|
Reusable button panel with declarative configuration. |
- class pyqt_reactive.widgets.shared.button_panel.ButtonPanel(button_configs: List[Tuple[str, str, str]], on_action: Callable[[str], None], style_generator=None, grid_columns: int = 0, parent: QWidget | None = None)[source]
Reusable button panel with declarative configuration.
Uses BUTTON_CONFIGS format: [(label, action_id, tooltip), …] Supports grid layout with configurable columns.
- __init__(button_configs: List[Tuple[str, str, str]], on_action: Callable[[str], None], style_generator=None, grid_columns: int = 0, parent: QWidget | None = None)[source]
Initialize button panel.
- Parameters:
button_configs – List of (label, action_id, tooltip) tuples
on_action – Callback function(action_id) when button is clicked
style_generator – Optional style generator for button styling
grid_columns – Number of columns (0 = single row)
parent – Parent widget