fix(theme): eliminate QSS/CFG duplication (#51)
Some checks failed
Build and Test / build (pull_request) Has been cancelled

- Make src/Gui/Stylesheets/KindredCreate.qss the single source of truth
- Generate PreferencePacks QSS copy at build time via configure_file()
- Merge missing preference defaults into PreferencePacks cfg:
  Document (undo, autosave, backup, license), TreeView (PreSelection,
  SyncView, SyncSelection), NotificationArea, OutputWindow recording,
  General (AutoloadModule=ZToolsWorkbench)
- Delete unused resources/preferences/KindredCreate/ directory
- Delete src/Gui/PreferencePacks/KindredCreate/KindredCreate.qss from source
- Update documentation to reflect single QSS location
This commit is contained in:
forbes
2026-02-08 17:41:26 -06:00
parent cf523f1d87
commit 6773ca0dfd
11 changed files with 42 additions and 2764 deletions

View File

@@ -98,7 +98,7 @@ create/
├── mods/ # Kindred addon workbenches (git submodules) ├── mods/ # Kindred addon workbenches (git submodules)
│ ├── ztools/ # ztools workbench │ ├── ztools/ # ztools workbench
│ └── silo/ # Silo parts database │ └── silo/ # Silo parts database
├── resources/preferences/ # Default preferences and theme ├── resources/ # Branding, icons, desktop integration
├── package/ # Packaging (Debian, AppImage, Windows installer, RPM) ├── package/ # Packaging (Debian, AppImage, Windows installer, RPM)
├── .gitea/workflows/ # CI/CD (build and release pipelines) ├── .gitea/workflows/ # CI/CD (build and release pipelines)
├── docs/ # Architecture and integration docs ├── docs/ # Architecture and integration docs

View File

@@ -52,7 +52,7 @@ mods/silo/ [submodule -> silo-mod.git] FreeCAD workbench
└── silo_origin.py FileOrigin backend for Silo └── silo_origin.py FileOrigin backend for Silo
src/Gui/Stylesheets/ QSS themes and SVG assets src/Gui/Stylesheets/ QSS themes and SVG assets
resources/preferences/ Canonical preference pack (KindredCreate) src/Gui/PreferencePacks/ KindredCreate preference pack (cfg + build-time QSS)
``` ```
See [INTEGRATION_PLAN.md](INTEGRATION_PLAN.md) for architecture layers and phase status. See [INTEGRATION_PLAN.md](INTEGRATION_PLAN.md) for architecture layers and phase status.

View File

@@ -77,13 +77,9 @@ These appear in the File menu and "Origin Tools" toolbar across all workbenches
## Theme ## Theme
**Canonical source:** `resources/preferences/KindredCreate/KindredCreate.qss` **Canonical source:** `src/Gui/Stylesheets/KindredCreate.qss`
Four copies must stay in sync: The PreferencePacks copy (`src/Gui/PreferencePacks/KindredCreate/KindredCreate.qss`) is generated at build time via `configure_file()` in `src/Gui/PreferencePacks/CMakeLists.txt`. Only the Stylesheets copy needs to be maintained.
1. `resources/preferences/KindredCreate/KindredCreate.qss` (canonical)
2. `src/Gui/Stylesheets/KindredCreate.qss`
3. `src/Gui/PreferencePacks/KindredCreate/KindredCreate.qss`
4. `mods/ztools/CatppuccinMocha/CatppuccinMocha.qss`
--- ---

View File

@@ -100,17 +100,13 @@ Pure Python workbenches following FreeCAD's addon pattern. Self-contained with `
**Decision:** Superseded by the AttachExtension approach. Only `tangent_to_cylinder` still uses manual placement (requires a vertex reference not currently collected by the UI). **Decision:** Superseded by the AttachExtension approach. Only `tangent_to_cylinder` still uses manual placement (requires a vertex reference not currently collected by the UI).
### Phase 4: Theme system -- PARTIAL ### Phase 4: Theme system -- DONE
**Goal:** Theme applies consistently at startup regardless of active workbench. **Goal:** Theme applies consistently at startup regardless of active workbench.
**Current state:** The Catppuccin Mocha theme is set as the default via the KindredCreate preference pack. Four copies of the QSS file exist and must be kept in sync manually: **Current state:** The Catppuccin Mocha theme is set as the default via the KindredCreate preference pack. The canonical QSS lives in `src/Gui/Stylesheets/KindredCreate.qss`. The PreferencePacks copy is generated at build time via `configure_file()` in `src/Gui/PreferencePacks/CMakeLists.txt`. The unused `resources/preferences/KindredCreate/` directory has been removed.
1. `resources/preferences/KindredCreate/KindredCreate.qss` (canonical)
2. `src/Gui/Stylesheets/KindredCreate.qss`
3. `src/Gui/PreferencePacks/KindredCreate/KindredCreate.qss`
4. `mods/ztools/CatppuccinMocha/CatppuccinMocha.qss`
**Remaining work:** Eliminate QSS duplication via build-time copy or symlinks. Move theme responsibility out of ztools and into the Create module. **Remaining work:** Move theme responsibility out of ztools and into the Create module.
### Phase 5: Silo deep integration -- DONE ### Phase 5: Silo deep integration -- DONE

View File

@@ -4,7 +4,7 @@
### Critical ### Critical
1. **QSS duplication.** Four copies of the stylesheet must be kept in sync manually. A build step or symlinks should eliminate this. 1. ~~**QSS duplication.**~~ Resolved. The canonical QSS lives in `src/Gui/Stylesheets/KindredCreate.qss`. The PreferencePacks copy is now generated at build time via `configure_file()` in `src/Gui/PreferencePacks/CMakeLists.txt`. The unused `resources/preferences/KindredCreate/` directory has been removed.
2. **WorkbenchManipulator timing.** The `_ZToolsPartDesignManipulator` appends commands by name. If ZToolsWorkbench hasn't been activated when the user switches to PartDesign, the commands may not be registered. The manipulator API tolerates missing commands silently, but buttons won't appear. 2. **WorkbenchManipulator timing.** The `_ZToolsPartDesignManipulator` appends commands by name. If ZToolsWorkbench hasn't been activated when the user switches to PartDesign, the commands may not be registered. The manipulator API tolerates missing commands silently, but buttons won't appear.

View File

@@ -1,129 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<FCParameters>
<FCParamGroup Name="Root">
<FCParamGroup Name="BaseApp">
<FCParamGroup Name="Preferences">
<FCParamGroup Name="Editor">
<FCUInt Name="Text" Value="3453416703"/>
<FCUInt Name="Bookmark" Value="3032415999"/>
<FCUInt Name="Breakpoint" Value="4086016255"/>
<FCUInt Name="Keyword" Value="3416717311"/>
<FCUInt Name="Comment" Value="2139095295"/>
<FCUInt Name="Block comment" Value="2139095295"/>
<FCUInt Name="Number" Value="4206069759"/>
<FCUInt Name="String" Value="2799935999"/>
<FCUInt Name="Character" Value="4073902335"/>
<FCUInt Name="Class name" Value="2310339327"/>
<FCUInt Name="Define name" Value="2310339327"/>
<FCUInt Name="Operator" Value="2312199935"/>
<FCUInt Name="Python output" Value="2796290303"/>
<FCUInt Name="Python error" Value="4086016255"/>
<FCUInt Name="Current line highlight" Value="1162304255"/>
</FCParamGroup>
<FCParamGroup Name="OutputWindow">
<FCUInt Name="colorText" Value="3453416703"/>
<FCUInt Name="colorLogging" Value="2497893887"/>
<FCUInt Name="colorWarning" Value="4192382975"/>
<FCUInt Name="colorError" Value="4086016255"/>
</FCParamGroup>
<FCParamGroup Name="View">
<FCUInt Name="BackgroundColor" Value="505294591"/>
<FCUInt Name="BackgroundColor2" Value="286333951"/>
<FCUInt Name="BackgroundColor3" Value="404235775"/>
<FCUInt Name="BackgroundColor4" Value="825378047"/>
<FCBool Name="Simple" Value="0"/>
<FCBool Name="Gradient" Value="1"/>
<FCBool Name="UseBackgroundColorMid" Value="0"/>
<FCUInt Name="HighlightColor" Value="3416717311"/>
<FCUInt Name="SelectionColor" Value="3032415999"/>
<FCUInt Name="PreselectColor" Value="2497893887"/>
<FCUInt Name="DefaultShapeColor" Value="1482387711"/>
<FCBool Name="RandomColor" Value="0"/>
<FCUInt Name="DefaultShapeLineColor" Value="2470768383"/>
<FCUInt Name="DefaultShapeVertexColor" Value="2470768383"/>
<FCUInt Name="BoundingBoxColor" Value="1819509759"/>
<FCUInt Name="AnnotationTextColor" Value="3453416703"/>
<FCUInt Name="SketchEdgeColor" Value="3453416703"/>
<FCUInt Name="SketchVertexColor" Value="3453416703"/>
<FCUInt Name="EditedEdgeColor" Value="3416717311"/>
<FCUInt Name="EditedVertexColor" Value="4123402495"/>
<FCUInt Name="ConstructionColor" Value="4206069759"/>
<FCUInt Name="ExternalColor" Value="4192382975"/>
<FCUInt Name="FullyConstrainedColor" Value="2799935999"/>
<FCUInt Name="InternalAlignedGeoColor" Value="1959907071"/>
<FCUInt Name="FullyConstraintElementColor" Value="2799935999"/>
<FCUInt Name="FullyConstraintConstructionElementColor" Value="2497893887"/>
<FCUInt Name="FullyConstraintInternalAlignmentColor" Value="2312199935"/>
<FCUInt Name="FullyConstraintConstructionPointColor" Value="2799935999"/>
<FCUInt Name="ConstrainedIcoColor" Value="2310339327"/>
<FCUInt Name="NonDrivingConstrDimColor" Value="2139095295"/>
<FCUInt Name="ConstrainedDimColor" Value="3416717311"/>
<FCUInt Name="ExprBasedConstrDimColor" Value="4206069759"/>
<FCUInt Name="DeactivatedConstrDimColor" Value="1819509759"/>
<FCUInt Name="CursorTextColor" Value="3453416703"/>
<FCUInt Name="CursorCrosshairColor" Value="3416717311"/>
<FCUInt Name="CreateLineColor" Value="2799935999"/>
<FCUInt Name="ShadowLightColor" Value="2470768128"/>
<FCUInt Name="ShadowGroundColor" Value="286333952"/>
<FCUInt Name="HiddenLineColor" Value="825378047"/>
<FCUInt Name="HiddenLineFaceColor" Value="505294591"/>
<FCUInt Name="HiddenLineBackground" Value="505294591"/>
<FCBool Name="EnableBacklight" Value="1"/>
<FCUInt Name="BacklightColor" Value="1162304255"/>
<FCFloat Name="BacklightIntensity" Value="0.30"/>
</FCParamGroup>
<FCParamGroup Name="Document">
<FCInt Name="MaxUndoSize" Value="50"/>
<FCInt Name="AutoSaveTimeout" Value="5"/>
<FCInt Name="CountBackupFiles" Value="3"/>
<FCInt Name="prefLicenseType" Value="19"/>
<FCText Name="prefLicenseUrl"></FCText>
</FCParamGroup>
<FCParamGroup Name="TreeView">
<FCUInt Name="TreeEditColor" Value="3416717311"/>
<FCUInt Name="TreeActiveColor" Value="2799935999"/>
<FCBool Name="PreSelection" Value="1"/>
<FCBool Name="SyncView" Value="1"/>
<FCBool Name="SyncSelection" Value="1"/>
</FCParamGroup>
<FCParamGroup Name="NotificationArea">
<FCInt Name="MaxWidgetMessages" Value="100"/>
<FCInt Name="MaxOpenNotifications" Value="3"/>
<FCInt Name="NotificiationWidth" Value="400"/>
<FCInt Name="NotificationTime" Value="10"/>
<FCInt Name="MinimumOnScreenTime" Value="3"/>
</FCParamGroup>
<FCParamGroup Name="General">
<FCText Name="AutoloadModule">ZToolsWorkbench</FCText>
</FCParamGroup>
<FCParamGroup Name="MainWindow">
<FCText Name="StyleSheet">KindredCreate.qss</FCText>
</FCParamGroup>
<FCParamGroup Name="Mod">
<FCParamGroup Name="Start">
<FCUInt Name="BackgroundColor1" Value="404235775"/>
<FCUInt Name="BackgroundTextColor" Value="3453416703"/>
<FCUInt Name="PageColor" Value="505294591"/>
<FCUInt Name="PageTextColor" Value="3453416703"/>
<FCUInt Name="BoxColor" Value="825378047"/>
<FCUInt Name="LinkColor" Value="2310339327"/>
<FCUInt Name="BackgroundColor2" Value="286333951"/>
</FCParamGroup>
<FCParamGroup Name="Part">
<FCUInt Name="VertexColor" Value="3032415999"/>
<FCUInt Name="EdgeColor" Value="2310339327"/>
</FCParamGroup>
<FCParamGroup Name="PartDesign">
<FCUInt Name="DefaultDatumColor" Value="3416717311"/>
</FCParamGroup>
<FCParamGroup Name="Draft">
<FCUInt Name="snapcolor" Value="2799935999"/>
</FCParamGroup>
<FCParamGroup Name="Sketcher">
<FCUInt Name="GridLineColor" Value="1162304255"/>
</FCParamGroup>
</FCParamGroup>
</FCParamGroup>
</FCParamGroup>
</FCParamGroup>
</FCParameters>

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<package format="1" xmlns="https://wiki.freecad.org/Package_Metadata">
<name>Kindred Create Preference Packs</name>
<description>Default preference packs for Kindred Create, featuring the Catppuccin Mocha color theme.</description>
<version>0.1.0</version>
<maintainer email="support@kindredsystems.net">Kindred Systems LLC</maintainer>
<license>LGPL-2.1-or-later</license>
<url type="website">https://kindredsystems.net</url>
<content>
<preferencepack>
<name>KindredCreate</name>
<description>The default Kindred Create theme based on Catppuccin Mocha - a soothing dark color palette.</description>
</preferencepack>
</content>
</package>

View File

@@ -12,6 +12,14 @@ ADD_CUSTOM_TARGET(PreferencePacks_data ALL
FILE(COPY ${PreferencePacks_Files} ${PreferencePacks_Directories} DESTINATION "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Gui/PreferencePacks") FILE(COPY ${PreferencePacks_Files} ${PreferencePacks_Directories} DESTINATION "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Gui/PreferencePacks")
# Copy KindredCreate.qss from Stylesheets into the PreferencePacks build directory.
# The canonical QSS lives in src/Gui/Stylesheets/; this avoids maintaining a duplicate. (#51)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/../Stylesheets/KindredCreate.qss
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Gui/PreferencePacks/KindredCreate/KindredCreate.qss
COPYONLY
)
fc_copy_sources(PreferencePacks_data "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Gui/PreferencePacks" fc_copy_sources(PreferencePacks_data "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Gui/PreferencePacks"
${PreferencePacks_Files} ${PreferencePacks_Files}
${PreferencePacks_Directories}) ${PreferencePacks_Directories})
@@ -23,9 +31,10 @@ INSTALL(
${CMAKE_INSTALL_DATADIR}/Gui/PreferencePacks ${CMAKE_INSTALL_DATADIR}/Gui/PreferencePacks
) )
# Install from build directory so the generated QSS copy is included
INSTALL( INSTALL(
DIRECTORY DIRECTORY
${PreferencePacks_Directories} ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Gui/PreferencePacks/KindredCreate
DESTINATION DESTINATION
${CMAKE_INSTALL_DATADIR}/Gui/PreferencePacks ${CMAKE_INSTALL_DATADIR}/Gui/PreferencePacks
) )

View File

@@ -25,6 +25,10 @@
<FCUInt Name="colorLogging" Value="2497893887" /> <FCUInt Name="colorLogging" Value="2497893887" />
<FCUInt Name="colorWarning" Value="4192382975" /> <FCUInt Name="colorWarning" Value="4192382975" />
<FCUInt Name="colorError" Value="4086016255" /> <FCUInt Name="colorError" Value="4086016255" />
<FCBool Name="checkError" Value="1" />
<FCBool Name="checkLogging" Value="1" />
<FCBool Name="checkShowReportViewOnError" Value="1" />
<FCBool Name="checkShowReportViewOnWarning" Value="1" />
</FCParamGroup> </FCParamGroup>
<FCParamGroup Name="View"> <FCParamGroup Name="View">
<FCUInt Name="BackgroundColor" Value="505294591" /> <FCUInt Name="BackgroundColor" Value="505294591" />
@@ -81,9 +85,29 @@
<FCUInt Name="BacklightColor" Value="1162304255" /> <FCUInt Name="BacklightColor" Value="1162304255" />
<FCFloat Name="BacklightIntensity" Value="0.30" /> <FCFloat Name="BacklightIntensity" Value="0.30" />
</FCParamGroup> </FCParamGroup>
<FCParamGroup Name="Document">
<FCInt Name="MaxUndoSize" Value="50" />
<FCInt Name="AutoSaveTimeout" Value="5" />
<FCInt Name="CountBackupFiles" Value="3" />
<FCInt Name="prefLicenseType" Value="19" />
<FCText Name="prefLicenseUrl"></FCText>
</FCParamGroup>
<FCParamGroup Name="TreeView"> <FCParamGroup Name="TreeView">
<FCUInt Name="TreeEditColor" Value="3416717311" /> <FCUInt Name="TreeEditColor" Value="3416717311" />
<FCUInt Name="TreeActiveColor" Value="2799935999" /> <FCUInt Name="TreeActiveColor" Value="2799935999" />
<FCBool Name="PreSelection" Value="1" />
<FCBool Name="SyncView" Value="1" />
<FCBool Name="SyncSelection" Value="1" />
</FCParamGroup>
<FCParamGroup Name="NotificationArea">
<FCInt Name="MaxWidgetMessages" Value="100" />
<FCInt Name="MaxOpenNotifications" Value="3" />
<FCInt Name="NotificiationWidth" Value="400" />
<FCInt Name="NotificationTime" Value="10" />
<FCInt Name="MinimumOnScreenTime" Value="3" />
</FCParamGroup>
<FCParamGroup Name="General">
<FCText Name="AutoloadModule">ZToolsWorkbench</FCText>
</FCParamGroup> </FCParamGroup>
<FCParamGroup Name="MainWindow"> <FCParamGroup Name="MainWindow">
<FCText Name="StyleSheet">KindredCreate.qss</FCText> <FCText Name="StyleSheet">KindredCreate.qss</FCText>

File diff suppressed because it is too large Load Diff