Skip to content

guitar_prometheus::Theming::AppLookAndFeel

guitar_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. More…

#include <AppLookAndFeel.h>

Inherits from juce::LookAndFeel_V4

Public Functions

Name
AppLookAndFeel()
~AppLookAndFeel() override =default
voidapplyTheme(const Theme & theme)
Replace the current colour palette with theme’s.
voiddrawMenuBarBackground(juce::Graphics & g, int width, int height, bool isMouseOverBar, juce::MenuBarComponent & menuBar) override
voiddrawMenuBarItem(juce::Graphics & g, int width, int height, int itemIndex, const juce::String & itemText, bool isMouseOverItem, bool isMenuOpen, bool isMouseOverBar, juce::MenuBarComponent & menuBar) override
juce::FontgetMonoFont(float sizePx)
A juce::Font configured to use Hack regular at the requested point size.

Detailed Description

class guitar_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.

Construction registers Mulish (variable, all UI weights) and Hack (regular, monospace) typefaces from BinaryData exactly once. Theme changes mutate this same instance via applyTheme(...), so the existing juce::Desktop::setDefaultLookAndFeel(...) registration stays valid across swaps and every component’s findColour(...) call routes through the new palette automatically.

Thread-affinity: must be constructed and used on the message thread. Theme application calls juce::Desktop::sendComponentLookAndFeelChange(...) indirectly via [ThemeManager](/api-reference/classes/classguitar__prometheus_1_1theming_1_1thememanager/).

Public Functions Documentation

function AppLookAndFeel

AppLookAndFeel()

function ~AppLookAndFeel

~AppLookAndFeel() override =default

function applyTheme

void applyTheme(
const Theme & theme
)

Replace the current colour palette with theme’s.

Walks the theme’s colours map and calls setColour(id, colour) for each entry, then explicitly populates the corresponding JUCE built-in ColourIds from the same source palette so dialogs, popups, and standard widgets pick up the theme without per-widget overrides.

function drawMenuBarBackground

void drawMenuBarBackground(
juce::Graphics & g,
int width,
int height,
bool isMouseOverBar,
juce::MenuBarComponent & menuBar
) override

function drawMenuBarItem

void drawMenuBarItem(
juce::Graphics & g,
int width,
int height,
int itemIndex,
const juce::String & itemText,
bool isMouseOverItem,
bool isMenuOpen,
bool isMouseOverBar,
juce::MenuBarComponent & menuBar
) override

function getMonoFont

static juce::Font getMonoFont(
float sizePx
)

A juce::Font configured to use Hack regular at the requested point size.

Use for monospace-aligned columns (MIDI program numbers, note names, byte values). JUCE 8’s LookAndFeel_V4 doesn’t expose a setDefaultMonospacedTypeface-style hook, so callers ask for the mono typeface explicitly via this static.


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