MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / factoryColor

Method factoryColor

src/core/ThemeManager.cpp:930–945  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

928}
929
930QColor ThemeManager::factoryColor(const QString& token) const
931{
932 ensureFactoryLoaded();
933 const auto it = m_factoryTokens.constFind(token);
934 if (it == m_factoryTokens.constEnd()) return QColor();
935 if (it.value().canConvert<ThemeGradient>()) {
936 // Token is a gradient in the factory baseline — graceful fallback
937 // to the first stop's colour, matching ThemeManager::color()'s
938 // behaviour for gradient tokens.
939 const auto g = it.value().value<ThemeGradient>();
940 if (g.stops.isEmpty()) return QColor();
941 return g.stops.first().color;
942 }
943 if (it.value().userType() != QMetaType::QString) return QColor();
944 return QColor(it.value().toString());
945}
946
947int ThemeManager::factorySizing(const QString& token) const
948{

Callers 2

onResetClickedMethod · 0.80
mainFunction · 0.80

Calls 3

valueMethod · 0.45
isEmptyMethod · 0.45
toStringMethod · 0.45

Tested by 1

mainFunction · 0.64