[studio,nostalgia] Update tab name when corresponding file's name changes
All checks were successful
Build / build (push) Successful in 3m30s
All checks were successful
Build / build (push) Successful in 3m30s
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
namespace studio {
|
||||
|
||||
ClawEditor::ClawEditor(StudioContext &sctx, ox::StringParam path):
|
||||
Editor(std::move(path)),
|
||||
Editor(sctx, std::move(path)),
|
||||
m_obj(sctx.project->loadObj<ox::ModelObject>(itemPath()).unwrapThrow()) {
|
||||
}
|
||||
|
||||
|
@ -373,7 +373,17 @@ ox::Error StudioUI::renameFile(ox::StringViewCR path) noexcept {
|
||||
return m_renameFile.openPath(path);
|
||||
}
|
||||
|
||||
ox::Error StudioUI::handleMoveFile(ox::StringViewCR, ox::UUID const&) noexcept {
|
||||
ox::Error StudioUI::handleMoveFile(ox::StringViewCR oldPath, ox::StringViewCR newPath, ox::UUID const&) noexcept {
|
||||
for (auto &f : m_openFiles) {
|
||||
if (f == oldPath) {
|
||||
f = newPath;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// needed to keep this tab open, ImGui loses track when the name changes
|
||||
if (m_activeEditor) {
|
||||
m_activeEditorUpdatePending = m_activeEditor;
|
||||
}
|
||||
return m_projectExplorer.refreshProjectTreeModel();
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ class StudioUI: public ox::SignalHandler {
|
||||
|
||||
ox::Error renameFile(ox::StringViewCR path) noexcept;
|
||||
|
||||
ox::Error handleMoveFile(ox::StringViewCR path, ox::UUID const&id) noexcept;
|
||||
ox::Error handleMoveFile(ox::StringViewCR oldPath, ox::StringViewCR newPath, ox::UUID const&id) noexcept;
|
||||
|
||||
ox::Error createOpenProject(ox::StringViewCR path) noexcept;
|
||||
|
||||
|
Reference in New Issue
Block a user