Gui: Add ThemeTokenManager class to contain theme parameters

This class aims to implement Design Token idea into FreeCAD themes. It
allows themes to use generic variables with generic values so we could
use one qss theme and change the style based on values from preference
packs.
This commit is contained in:
Kacper Donat
2025-04-06 22:36:06 +02:00
parent 8d1f65e992
commit a32594faea
23 changed files with 3749 additions and 93 deletions

View File

@@ -133,6 +133,8 @@ public:
if (activeStyleSheet.isEmpty()) {
activeStyleSheet = _default;
}
activeStyleSheet = Application::Instance->replaceVariablesInQss(activeStyleSheet);
}
ParameterGrp::handle handle;
@@ -157,7 +159,7 @@ private:
}
else if (!overlayStyleSheet.isEmpty() && !QFile::exists(overlayStyleSheet)) {
// User did choose one of predefined stylesheets, we need to qualify it with namespace
overlayStyleSheet = QStringLiteral("overlay:%1").arg(overlayStyleSheet);
overlayStyleSheet = QStringLiteral("overlay:%1").arg(overlayStyleSheet);
}
return overlayStyleSheet;