Enhance theme management with dynamic discovery and macOS bundle support

- Updated CMake configuration to ensure theme files are included in macOS bundles and added explicit file handling for theme resources.
- Refactored ThemeManager to replace hardcoded theme lists with dynamic discovery of available themes, improving flexibility across development and deployment scenarios.
- Introduced methods for refreshing and loading themes at runtime, enhancing user experience and customization options.
- Improved logging for theme loading processes, providing better feedback on successes and failures.
This commit is contained in:
scawful
2025-09-26 19:55:40 -04:00
parent 83d31556bb
commit c5e8e04f65
4 changed files with 190 additions and 16 deletions

View File

@@ -32,6 +32,10 @@ set(YAZE_RESOURCE_FILES
${CMAKE_SOURCE_DIR}/assets/font/MaterialIcons-Regular.ttf
)
# Add theme files for macOS bundle (replacing the glob pattern with explicit files)
file(GLOB YAZE_THEME_FILES "${CMAKE_SOURCE_DIR}/assets/themes/*.theme")
list(APPEND YAZE_RESOURCE_FILES ${YAZE_THEME_FILES})
foreach (FILE ${YAZE_RESOURCE_FILES})
file(RELATIVE_PATH NEW_FILE "${CMAKE_SOURCE_DIR}/assets" ${FILE})
get_filename_component(NEW_FILE_PATH ${NEW_FILE} DIRECTORY)