pyqt_reactive.theming.palette_manager
QPalette Manager for OpenHCS PyQt6 GUI
Manages QPalette integration with ColorScheme for system-wide theming. Provides utilities for applying color schemes to Qt’s palette system and managing theme switching across the entire application.
Classes
|
Manages QPalette integration with ColorScheme. |
|
High-level theme management for the entire application. |
- class pyqt_reactive.theming.palette_manager.PaletteManager(color_scheme: ColorScheme)[source]
Manages QPalette integration with ColorScheme.
Provides methods to apply color schemes to Qt’s palette system, enabling system-wide theming and consistent color application.
- __init__(color_scheme: ColorScheme)[source]
Initialize the palette manager with a color scheme.
- Parameters:
color_scheme – ColorScheme instance to use for palette generation
- update_color_scheme(color_scheme: ColorScheme)[source]
Update the color scheme used for palette generation.
- Parameters:
color_scheme – New ColorScheme instance
- create_palette() QPalette[source]
Create a QPalette from the current color scheme.
- Returns:
Configured palette with color scheme colors
- Return type:
QPalette
- apply_palette_to_application(app: QApplication | None = None)[source]
Apply the color scheme palette to the entire application.
- Parameters:
app – QApplication instance (uses QApplication.instance() if None)
- class pyqt_reactive.theming.palette_manager.ThemeManager(initial_color_scheme: ColorScheme | None = None)[source]
High-level theme management for the entire application.
Coordinates color scheme, style sheet generation, and palette management to provide seamless theme switching capabilities.
- __init__(initial_color_scheme: ColorScheme | None = None)[source]
Initialize the theme manager.
- Parameters:
initial_color_scheme – Initial color scheme (defaults to dark theme)
- apply_color_scheme(color_scheme: ColorScheme)[source]
Apply a new color scheme to the entire application.
- Parameters:
color_scheme – New ColorScheme to apply
- register_theme_change_callback(callback)[source]
Register a callback to be called when theme changes.
- Parameters:
callback – Function to call with new color scheme
- unregister_theme_change_callback(callback)[source]
Unregister a theme change callback.
- Parameters:
callback – Function to remove from callbacks
- get_current_style_sheet() str[source]
Get the current complete application style sheet.
- Returns:
Complete QStyleSheet for current theme
- Return type: