feat(ztools): migrate to kindred_sdk palette system (#278) #283

Merged
forbes merged 2 commits from feat/ztools-sdk-migration into main 2026-02-19 20:48:39 +00:00
Owner

Summary

Migrates ztools to use the kindred_sdk palette system, eliminating the duplicated Catppuccin Mocha color definitions.

Changes

mods/ztools/package.xml

  • Added element declaring: sdk dependency, load_priority:50, min_create_version:0.1.0, pure_python:true
  • This enables proper manifest-driven loading via addon_loader.py with correct dependency ordering (sdk:0 -> ztools:50 -> silo:60)

mods/ztools/ztools/ztools/resources/theme.py

  • QSS generation now sources colors from kindred_sdk.get_theme_tokens() with fallback to local MOCHA dict
  • apply_spreadsheet_colors() uses kindred_sdk.load_palette().hex_to_rgba_uint() with local fallback
  • Both paths produce identical output -- the SDK palette YAML has the same hex values

Design decisions

  • Graceful fallback: Every SDK import is wrapped in try/except, so ztools still works if SDK is unavailable
  • icons.py unchanged: SVG icon definitions run at import time before GUI init, so they keep the local MOCHA dict
  • No behavioral change: Same colors, same stylesheet, same spreadsheet preferences -- just sourced from the shared SDK palette

Closes #278

## Summary Migrates ztools to use the kindred_sdk palette system, eliminating the duplicated Catppuccin Mocha color definitions. ## Changes ### mods/ztools/package.xml - Added <kindred> element declaring: sdk dependency, load_priority:50, min_create_version:0.1.0, pure_python:true - This enables proper manifest-driven loading via addon_loader.py with correct dependency ordering (sdk:0 -> ztools:50 -> silo:60) ### mods/ztools/ztools/ztools/resources/theme.py - QSS generation now sources colors from kindred_sdk.get_theme_tokens() with fallback to local MOCHA dict - apply_spreadsheet_colors() uses kindred_sdk.load_palette().hex_to_rgba_uint() with local fallback - Both paths produce identical output -- the SDK palette YAML has the same hex values ### Design decisions - Graceful fallback: Every SDK import is wrapped in try/except, so ztools still works if SDK is unavailable - icons.py unchanged: SVG icon definitions run at import time before GUI init, so they keep the local MOCHA dict - No behavioral change: Same colors, same stylesheet, same spreadsheet preferences -- just sourced from the shared SDK palette Closes #278
forbes added 1 commit 2026-02-19 20:35:58 +00:00
chore: update mods/ztools pointer for SDK migration (#278)
All checks were successful
Build and Test / build (pull_request) Successful in 29m54s
6690d0355a
Points to feat/sdk-migration branch with kindred_sdk palette integration.
forbes added 1 commit 2026-02-19 20:47:05 +00:00
refactor: extract theme from ztools into base distribution (#278)
All checks were successful
Build and Test / build (pull_request) Successful in 29m25s
0330396843
- Add Spreadsheet color preferences to KindredCreate.cfg using FCText
  entries (TextColor, AliasedCellBackgroundColor, PositiveNumberColor,
  NegativeNumberColor) matching the C++ GetASCII() reader in SheetModel.cpp
- Remove CatppuccinMocha install directive from CMakeLists.txt
- Update ztools submodule: theme.py deleted, CatppuccinMocha preference
  pack removed, package.xml cleaned up

The previous apply_spreadsheet_colors() in ztools was a no-op: it called
SetUnsigned() but the Spreadsheet C++ reads GetASCII() — different param
types in FreeCAD's parameter system. Now properly fixed via preference pack.

Closes #278
forbes merged commit 0bc2cf3b6a into main 2026-02-19 20:48:39 +00:00
forbes deleted branch feat/ztools-sdk-migration 2026-02-19 20:48:40 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#283