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

@@ -41,9 +41,12 @@
#include "DockWindowManager.h"
#include "ToolBarManager.h"
#include <Application.h>
#include <App/Application.h>
#include <ctime> // For generating a timestamped filename
#include <ctime> // For generating a timestamped filename
#include <Base/ServiceProvider.h>
#include <Dialogs/DlgThemeEditor.h>
using namespace Gui;
@@ -359,6 +362,9 @@ bool PreferencePackManager::apply(const std::string& preferencePackName) const
Gui::ToolBarManager* pToolbarMgr = Gui::ToolBarManager::getInstance();
pToolbarMgr->restoreState();
// We need to reload stylesheet to apply any changed style parameters
Gui::Application::Instance->reloadStyleSheet();
// TODO: Are there other things that have to be manually triggered?
}
return wasApplied;