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

@@ -356,6 +356,33 @@ struct BaseExport ZipTools
};
/**
* Helper struct to define inline overloads for the visitor pattern in std::visit.
*
* It uses type deduction to infer the type from the expression and creates a dedicated type that
* essentially is callable using any overload supplied.
*
* @code
* using Base::Overloads;
*
* const auto visitor = Overloads
* {
* [](int i){ std::print("int = {}\n", i); },
* [](std::string_view s){ std::println("string = “{}”", s); },
* [](const Base&){ std::println("base"); },
* };
* @endcode
*
* @see https://en.cppreference.com/w/cpp/utility/variant/visit
*
* @tparam Ts Types for functions that will be used for overloads
*/
template<class... Ts>
struct Overloads: Ts...
{
using Ts::operator()...;
};
} // namespace Base
#endif // SRC_BASE_TOOLS_H_