Skip to content

guitar_prometheus::Theming

guitar_prometheus::Theming

Classes

Name
classguitar_prometheus::Theming::AppLookAndFeel
Single application-wide juce::LookAndFeel_V4 subclass that owns the bundled fonts and applies any of the six theme variants the app ships with.
structguitar_prometheus::Theming::Theme
A complete colour palette for one variant (dark or light) of a theme pair.
classguitar_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.
structguitar_prometheus::Theming::ThemePair
A pair of related themes (one dark, one light) the user can pick as a unit.

Types

Name
enum classMode { Light, Dark, FollowSystem}
How the active theme variant should be picked from a pair’s dark/light split.

Functions

Name
boolshouldUseDarkVariant(Mode mode, bool isSystemDark)
Returns true if the dark variant of the active pair should be used.
std::stringmodeToString(Mode mode)
Serialize a Mode value to a stable on-disk string.
ModemodeFromString(const std::string & s)
Parse a Mode value from its on-disk string form.
const std::vector< ThemePair > &allThemePairs()
Returns the three theme pairs the app ships with, in display order.
const ThemePair &findPairOrDefault(const juce::String & id)
Look up a pair by id, falling back to the first pair when id is empty or unrecognized.

Types Documentation

enum Mode

EnumeratorValueDescription
Light
Dark
FollowSystem

How the active theme variant should be picked from a pair’s dark/light split.

FollowSystem is the default: the variant tracks juce::Desktop::isDarkModeActive() and updates when the OS appearance setting changes. Light and Dark pin the variant regardless of the system setting — useful when the user wants the app to look the same in any environment.

Functions Documentation

function shouldUseDarkVariant

bool shouldUseDarkVariant(
Mode mode,
bool isSystemDark
)

Returns true if the dark variant of the active pair should be used.

Pure helper. Unit-testable without any JUCE dependency. Keep this stateless: callers (the [ThemeManager](/api-reference/classes/classguitar__prometheus_1_1theming_1_1thememanager/)) own the Mode enum and the system-dark bool and pass both in.

function modeToString

std::string modeToString(
Mode mode
)

Serialize a Mode value to a stable on-disk string.

Used by [AppPreferences](/api-reference/classes/classguitar__prometheus_1_1apppreferences/) to persist themeMode across launches. The string form is stable across schema versions (no migration required) — the canonical strings are “light”, “dark”, “followSystem”.

function modeFromString

Mode modeFromString(
const std::string & s
)

Parse a Mode value from its on-disk string form.

Defaults to Mode::FollowSystem when the input is empty, unrecognized, or absent (e.g. first-launch preferences with no theme key set yet).

function allThemePairs

const std::vector< ThemePair > & allThemePairs()

Returns the three theme pairs the app ships with, in display order.

The list is constructed once on first call and held in a function-local static. Safe to call from any thread because the construction happens during single-threaded startup.

function findPairOrDefault

const ThemePair & findPairOrDefault(
const juce::String & id
)

Look up a pair by id, falling back to the first pair when id is empty or unrecognized.

Used during app launch when AppPreferences may not have a theme key yet (first run) — the fallback gives a deterministic default without forcing the caller to handle nullopt.


Updated on 2026-05-29 at 07:39:53 +0000