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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user