guitar_prometheus::Theming::ThemeManager
guitar_prometheus::Theming::ThemeManager
Owns the application’s [AppLookAndFeel](/api-reference/classes/classguitar__prometheus_1_1theming_1_1applookandfeel/), listens for OS dark-mode changes, and broadcasts to UI components when the user picks a different theme pair or mode. More…
#include <ThemeManager.h>
Inherits from juce::ChangeBroadcaster, juce::DarkModeSettingListener
Public Functions
| Name | |
|---|---|
| ThemeManager(AppPreferences & prefs) Construct the manager, install the LookAndFeel, and apply the variant the preferences point to (defaulting to Default + FollowSystem on first launch). | |
| ~ThemeManager() override | |
| void | setPair(const juce::String & pairId) Switch to the named pair. |
| void | setMode(Mode mode) Switch the variant-selection mode. |
| const juce::String & | currentPairId() const Currently-selected pair id (e.g. |
| Mode | currentMode() const Currently-selected variant mode. |
| void | darkModeSettingChanged() override OS dark-mode listener entry point. |
Detailed Description
class guitar_prometheus::Theming::ThemeManager;Owns the application’s [AppLookAndFeel](/api-reference/classes/classguitar__prometheus_1_1theming_1_1applookandfeel/), listens for OS dark-mode changes, and broadcasts to UI components when the user picks a different theme pair or mode.
The manager is constructed once at app launch (in main.cpp), holds the single [AppLookAndFeel](/api-reference/classes/classguitar__prometheus_1_1theming_1_1applookandfeel/) instance for the process lifetime, and registers it as the default look-and-feel on juce::Desktop. UI panels read [currentPairId()](/api-reference/classes/classguitar__prometheus_1_1theming_1_1thememanager/#function-currentpairid) / [currentMode()](/api-reference/classes/classguitar__prometheus_1_1theming_1_1thememanager/#function-currentmode) for menu check-mark state and call setPair(...) / setMode(...) to cause a theme swap.
Inherits juce::ChangeBroadcaster so the menu can refresh its tick state when a theme swap happens outside the menu’s own command path (e.g. an OS dark-mode toggle while Follow System is active).
Public Functions Documentation
function ThemeManager
explicit ThemeManager( AppPreferences & prefs)Construct the manager, install the LookAndFeel, and apply the variant the preferences point to (defaulting to Default + FollowSystem on first launch).
Registers itself as a juce::DarkModeSettingListener so OS appearance changes propagate when the user is in FollowSystem mode.
function ~ThemeManager
~ThemeManager() overridefunction setPair
void setPair( const juce::String & pairId)Switch to the named pair.
No-op if pairId is unknown. Persists the new selection.
function setMode
void setMode( Mode mode)Switch the variant-selection mode.
Persists. Triggers an immediate re-pick + repaint.
function currentPairId
const juce::String & currentPairId() constCurrently-selected pair id (e.g.
“default”).
function currentMode
Mode currentMode() constCurrently-selected variant mode.
function darkModeSettingChanged
void darkModeSettingChanged() overrideOS dark-mode listener entry point.
Updated on 2026-05-29 at 07:39:53 +0000