MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / pickerThemeIsLight

Function pickerThemeIsLight

pj_widgets/src/DateRangePicker.cpp:60–62  ·  view source on GitHub ↗

The app persists its active theme to QSettings("StyleSheet::theme") (Theme.cpp) — the same key the rest of pj_dialog_host (widget_binding.cpp) reads. We key off it because the calendar paints from palette() roles, but the app pins QPalette at Fusion defaults regardless of the active QSS theme, so palette() resolves to Fusion light-grey on both themes. Sourcing colors from theme tokens chosen by th

Source from the content-addressed store, hash-verified

58// so palette() resolves to Fusion light-grey on both themes. Sourcing colors
59// from theme tokens chosen by this key is the fix.
60bool pickerThemeIsLight() {
61 return QSettings().value(QStringLiteral("StyleSheet::theme"), QStringLiteral("light")).toString().contains("light");
62}
63
64// Theme-token color set for the calendar/overlay. Values mirror the app's QSS
65// tokens (light / dark) so the picker reads correctly on both themes. The

Callers 2

pickerTokensFunction · 0.85
renderThemedIconFunction · 0.85

Calls 4

toStringMethod · 0.80
QSettingsClass · 0.50
containsMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected