Manages the connection between AppearanceTracker and Theme switching.
More...
#include <appearance_tracker.hpp>
Manages the connection between AppearanceTracker and Theme switching.
Holds a light theme, dark theme, and optional locked theme.
◆ ThemeManager()
| pulp::view::ThemeManager::ThemeManager |
( |
| ) |
|
◆ active_theme()
| const Theme & pulp::view::ThemeManager::active_theme |
( |
| ) |
const |
Get the active theme based on current appearance (or locked theme).
◆ is_locked()
| bool pulp::view::ThemeManager::is_locked |
( |
| ) |
const |
|
inline |
Check if a specific theme is locked.
◆ lock_appearance()
| void pulp::view::ThemeManager::lock_appearance |
( |
Appearance | appearance | ) |
|
Lock to an appearance (light/dark) but still use the theme pair.
◆ lock_theme()
| void pulp::view::ThemeManager::lock_theme |
( |
Theme | theme | ) |
|
Lock to a specific theme, ignoring appearance tracking.
◆ mode()
| ThemeMode pulp::view::ThemeManager::mode |
( |
| ) |
const |
◆ on_theme_changed()
| void pulp::view::ThemeManager::on_theme_changed |
( |
std::function< void(const Theme &)> | callback | ) |
|
Register a callback for when the active theme changes.
◆ poll()
| bool pulp::view::ThemeManager::poll |
( |
| ) |
|
Poll for changes. Returns true if the active theme changed.
◆ set_mode()
| void pulp::view::ThemeManager::set_mode |
( |
ThemeMode | m | ) |
|
User-facing theme preference.
set_mode(system) resumes OS tracking; light/dark pin the corresponding theme from the pair. This is the recommended surface — it maps onto lock_appearance()/unlock() so the system/light/dark choice round-trips cleanly via mode().
◆ set_theme_pair()
| void pulp::view::ThemeManager::set_theme_pair |
( |
Theme | light_theme, |
|
|
Theme | dark_theme ) |
Set the theme pair for automatic appearance-based switching.
◆ tracker() [1/2]
Access the underlying tracker for direct appearance queries.
◆ tracker() [2/2]
◆ unlock()
| void pulp::view::ThemeManager::unlock |
( |
| ) |
|
Unlock and resume automatic theme switching.
The documentation for this class was generated from the following file: