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