Preserve saved editor dock layouts

This commit is contained in:
2026-04-01 16:43:46 +08:00
parent 3f18530396
commit 6e2711f9e8
3 changed files with 67 additions and 4 deletions

View File

@@ -194,7 +194,7 @@ bool Application::SwitchProject(const std::string& projectPath) {
return false;
}
m_imguiSession.SetProjectPath(projectPath);
const bool hasSavedDockLayout = m_imguiSession.SetProjectPath(projectPath);
m_editorContext->SetProjectPath(projectPath);
auto& logger = Debug::Logger::Get();
@@ -208,6 +208,11 @@ bool Application::SwitchProject(const std::string& projectPath) {
m_lastWindowTitle.clear();
UpdateWindowTitle();
if (!hasSavedDockLayout) {
m_editorContext->GetEventBus().Publish(DockLayoutResetRequestedEvent{});
}
return true;
}