fix(gui): resolve unknown command and style token errors at startup

Move ZTools command imports before workbench initialization in
InitGui.py so commands are registered before PartDesign/Sketcher
init triggers toolbar state restoration.

Import silo_commands eagerly in _setup_silo_menu() so Silo commands
exist before the WorkbenchManipulator references them.

Create KindredCreate.yaml and Classic.yaml theme parameter files
defining all style tokens (PrimaryColor, TextForegroundColor, etc.)
used by FreeCAD.qss and the overlay stylesheet. Register them in
CMakeLists.txt and set the Theme preference in KindredCreate.cfg.

Add migration in migrateOldTheme() to set Theme=KindredCreate for
existing users who have the stylesheet but not the Theme parameter.
This commit is contained in:
forbes
2026-01-31 11:47:28 -06:00
parent eb80c07f57
commit 8639b6fd8a
7 changed files with 274 additions and 78 deletions

View File

@@ -68,6 +68,9 @@ def _check_silo_first_start():
def _setup_silo_menu():
"""Inject Silo commands into the File menu and toolbar across all workbenches."""
try:
# Import silo_commands eagerly so commands are registered before the
# manipulator tries to add them to toolbars/menus.
import silo_commands # noqa: F401
class SiloMenuManipulator:
def modifyMenuBar(self):