Catalog native UI state platform policy

This commit is contained in:
2026-06-05 11:41:05 +02:00
parent b1d71f2621
commit c4d00258ff
8 changed files with 27 additions and 12 deletions

View File

@@ -43,6 +43,11 @@ bool platform_enables_live_asset_reloading(PlatformFamily family) noexcept
return family == PlatformFamily::windows || family == PlatformFamily::macos;
}
bool platform_saves_native_ui_state(PlatformFamily family) noexcept
{
return family == PlatformFamily::windows || family == PlatformFamily::macos;
}
bool platform_supports_working_directory_picker(PlatformFamily family) noexcept
{
return family == PlatformFamily::windows || family == PlatformFamily::macos;

View File

@@ -23,6 +23,7 @@ enum class PlatformFamily {
[[nodiscard]] bool platform_publishes_exported_images(PlatformFamily family) noexcept;
[[nodiscard]] bool platform_flushes_persistent_storage(PlatformFamily family) noexcept;
[[nodiscard]] bool platform_enables_live_asset_reloading(PlatformFamily family) noexcept;
[[nodiscard]] bool platform_saves_native_ui_state(PlatformFamily family) noexcept;
[[nodiscard]] bool platform_supports_working_directory_picker(PlatformFamily family) noexcept;
[[nodiscard]] bool platform_uses_prepared_file_writes(PlatformFamily family) noexcept;
[[nodiscard]] bool platform_uses_work_directory_document_export_collections(PlatformFamily family) noexcept;

View File

@@ -337,6 +337,8 @@ public:
void save_ui_state() override
{
if (!pp::platform::platform_saves_native_ui_state(pp::platform::current_platform_family()))
return;
#ifdef __OSX__
[App::I->osx_app save_ui_state];
#endif

View File

@@ -405,6 +405,8 @@ public:
void save_ui_state() override
{
if (!pp::platform::platform_saves_native_ui_state(pp::platform::PlatformFamily::windows))
return;
win32_save_window_state();
}