Informational — no action needed in Meta unless you want the design changed. Recording it because
it cost a while to spot, and any future host will hit exactly the same thing.
What happens
Every custom-painted MetaUI widget sources its colours from QPalette:
slider_float.cpp, slider_int.cpp — Base, Text, Highlight, HighlightedText, Mid
range_bar.cpp, curve_canvas.cpp, points_canvas.cpp, xy_canvas.cpp, vector_canvas.cpp,
gradient_picker.cpp — same roles
That is the right Qt idiom, but it means the host has to put its theme into the palette. A host
that themes itself with a stylesheet — which is the common case, and what Hesiod does — does
not thereby populate the palette: a stylesheet color: rule only reaches widgets Qt draws
itself, never a paintEvent() that calls palette().color(...).
The result is silent and easy to misread as a styling bug in Meta: the widgets fall back to the
platform palette. On Hesiod/Windows that was near-black Text on a #2B2B2B background —
labels and values almost invisible — and Highlight resolving to the Windows system accent
instead of the application's, so fill bars and handles were the wrong blue.
Worth noting the predecessor did this differently: QSliderX exposed an explicit colour channel
(qsx::Config::global.color_text, color_bg, color_border, …) that the host pushed values into.
Migrating to MetaUI removes that channel, and nothing fails loudly when a host forgets to replace
it with palette setup.
Fix on the host side
Hesiod resolved it in otto-link/Hesiod@c175920d by building a QPalette from the same colour set
its stylesheet placeholders use and calling app.setPalette(pal) before setStyleSheet(...).
Widgets Qt draws itself are unaffected — the stylesheet still wins for those.
Possible follow-ups in Meta, your call
- Document it — a line in the MetaUI readme saying widgets read
QPalette and hosts must
populate it, which is probably enough.
- Provide a helper — e.g.
meta::qt::apply_theme(QApplication&, const ThemeColors&) so hosts
have an obvious entry point rather than having to know which palette roles matter.
- Leave as-is — palette is the idiomatic Qt answer; this issue then just serves as the
searchable record of the failure mode.
Informational — no action needed in Meta unless you want the design changed. Recording it because
it cost a while to spot, and any future host will hit exactly the same thing.
What happens
Every custom-painted MetaUI widget sources its colours from
QPalette:slider_float.cpp,slider_int.cpp—Base,Text,Highlight,HighlightedText,Midrange_bar.cpp,curve_canvas.cpp,points_canvas.cpp,xy_canvas.cpp,vector_canvas.cpp,gradient_picker.cpp— same rolesThat is the right Qt idiom, but it means the host has to put its theme into the palette. A host
that themes itself with a stylesheet — which is the common case, and what Hesiod does — does
not thereby populate the palette: a stylesheet
color:rule only reaches widgets Qt drawsitself, never a
paintEvent()that callspalette().color(...).The result is silent and easy to misread as a styling bug in Meta: the widgets fall back to the
platform palette. On Hesiod/Windows that was near-black
Texton a#2B2B2Bbackground —labels and values almost invisible — and
Highlightresolving to the Windows system accentinstead of the application's, so fill bars and handles were the wrong blue.
Worth noting the predecessor did this differently:
QSliderXexposed an explicit colour channel(
qsx::Config::global.color_text,color_bg,color_border, …) that the host pushed values into.Migrating to MetaUI removes that channel, and nothing fails loudly when a host forgets to replace
it with palette setup.
Fix on the host side
Hesiod resolved it in
otto-link/Hesiod@c175920dby building aQPalettefrom the same colour setits stylesheet placeholders use and calling
app.setPalette(pal)beforesetStyleSheet(...).Widgets Qt draws itself are unaffected — the stylesheet still wins for those.
Possible follow-ups in Meta, your call
QPaletteand hosts mustpopulate it, which is probably enough.
meta::qt::apply_theme(QApplication&, const ThemeColors&)so hostshave an obvious entry point rather than having to know which palette roles matter.
searchable record of the failure mode.