Compare commits
4 Commits
7f0dcdd280
...
e7b83be867
Author | SHA1 | Date | |
---|---|---|---|
e7b83be867 | |||
649da5fca8 | |||
aa095f7680 | |||
bb99c99f01 |
@ -3,12 +3,14 @@
|
|||||||
* Add app icon for both window and file
|
* Add app icon for both window and file
|
||||||
* Closing application will now confirm with user if any files have unsaved
|
* Closing application will now confirm with user if any files have unsaved
|
||||||
changes.
|
changes.
|
||||||
* Fix selection clearing in TileSheet editor to work when clicking outside
|
|
||||||
image.
|
|
||||||
* Fix color number key range in PalettEditor. Previously, pressing A caused the
|
|
||||||
editor to jump to the last color.
|
|
||||||
* UUID duplicates will now be reported when opening a project
|
* UUID duplicates will now be reported when opening a project
|
||||||
* PalettEditor: page rename will now take effect upon pressing enter if the
|
* Deleting a directory now closes files in that directory
|
||||||
|
* Delete key now initiates deletion of selected directory
|
||||||
|
* TileSheetEditor: Fix selection clearing in to work when clicking outside
|
||||||
|
image.
|
||||||
|
* PaletteEditor: Fix color number key range in. Previously, pressing A caused
|
||||||
|
the editor to jump to the last color.
|
||||||
|
* PaletteEditor: page rename will now take effect upon pressing enter if the
|
||||||
text input has focus
|
text input has focus
|
||||||
|
|
||||||
# d2025.02.1
|
# d2025.02.1
|
||||||
|
Binary file not shown.
@ -478,6 +478,18 @@ ox::Error StudioUI::handleMoveFile(ox::StringViewCR oldPath, ox::StringViewCR ne
|
|||||||
return m_projectExplorer.refreshProjectTreeModel();
|
return m_projectExplorer.refreshProjectTreeModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ox::Error StudioUI::handleDeleteDir(ox::StringViewCR path) noexcept {
|
||||||
|
auto const p = sfmt("{}/", path);
|
||||||
|
for (auto &e : m_editors) {
|
||||||
|
if (beginsWith(e->itemPath(), p)) {
|
||||||
|
oxLogError(closeFile(path));
|
||||||
|
m_closeActiveTab = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return m_projectExplorer.refreshProjectTreeModel();
|
||||||
|
}
|
||||||
|
|
||||||
ox::Error StudioUI::handleDeleteFile(ox::StringViewCR path) noexcept {
|
ox::Error StudioUI::handleDeleteFile(ox::StringViewCR path) noexcept {
|
||||||
for (auto &e : m_editors) {
|
for (auto &e : m_editors) {
|
||||||
if (path == e->itemPath()) {
|
if (path == e->itemPath()) {
|
||||||
@ -523,6 +535,7 @@ ox::Error StudioUI::openProjectPath(ox::StringParam path) noexcept {
|
|||||||
m_newDirDialog.newDir.connect(m_sctx.project, &Project::mkdir);
|
m_newDirDialog.newDir.connect(m_sctx.project, &Project::mkdir);
|
||||||
m_project->dirAdded.connect(&m_projectExplorer, &ProjectExplorer::refreshProjectTreeModel);
|
m_project->dirAdded.connect(&m_projectExplorer, &ProjectExplorer::refreshProjectTreeModel);
|
||||||
m_project->fileAdded.connect(&m_projectExplorer, &ProjectExplorer::refreshProjectTreeModel);
|
m_project->fileAdded.connect(&m_projectExplorer, &ProjectExplorer::refreshProjectTreeModel);
|
||||||
|
m_project->dirDeleted.connect(this, &StudioUI::handleDeleteDir);
|
||||||
m_project->fileDeleted.connect(this, &StudioUI::handleDeleteFile);
|
m_project->fileDeleted.connect(this, &StudioUI::handleDeleteFile);
|
||||||
m_project->fileMoved.connect(this, &StudioUI::handleMoveFile);
|
m_project->fileMoved.connect(this, &StudioUI::handleMoveFile);
|
||||||
m_openFiles.clear();
|
m_openFiles.clear();
|
||||||
|
@ -126,6 +126,8 @@ class StudioUI: public ox::SignalHandler {
|
|||||||
|
|
||||||
ox::Error handleMoveFile(ox::StringViewCR oldPath, ox::StringViewCR newPath, ox::UUID const&id) noexcept;
|
ox::Error handleMoveFile(ox::StringViewCR oldPath, ox::StringViewCR newPath, ox::UUID const&id) noexcept;
|
||||||
|
|
||||||
|
ox::Error handleDeleteDir(ox::StringViewCR path) noexcept;
|
||||||
|
|
||||||
ox::Error handleDeleteFile(ox::StringViewCR path) noexcept;
|
ox::Error handleDeleteFile(ox::StringViewCR path) noexcept;
|
||||||
|
|
||||||
ox::Error createOpenProject(ox::StringViewCR path) noexcept;
|
ox::Error createOpenProject(ox::StringViewCR path) noexcept;
|
||||||
|
@ -23,6 +23,7 @@ enum class ProjectEvent {
|
|||||||
// FileRecognized is triggered for all matching files upon a new
|
// FileRecognized is triggered for all matching files upon a new
|
||||||
// subscription to a section of the project and upon the addition of a file.
|
// subscription to a section of the project and upon the addition of a file.
|
||||||
FileRecognized,
|
FileRecognized,
|
||||||
|
DirDeleted,
|
||||||
FileDeleted,
|
FileDeleted,
|
||||||
FileUpdated,
|
FileUpdated,
|
||||||
FileMoved,
|
FileMoved,
|
||||||
@ -134,6 +135,7 @@ class Project: public ox::SignalHandler {
|
|||||||
// file.
|
// file.
|
||||||
ox::Signal<ox::Error(ox::StringViewCR)> fileRecognized;
|
ox::Signal<ox::Error(ox::StringViewCR)> fileRecognized;
|
||||||
ox::Signal<ox::Error(ox::StringViewCR)> fileDeleted;
|
ox::Signal<ox::Error(ox::StringViewCR)> fileDeleted;
|
||||||
|
ox::Signal<ox::Error(ox::StringViewCR)> dirDeleted;
|
||||||
ox::Signal<ox::Error(ox::StringViewCR path, ox::UUID const&id)> fileUpdated;
|
ox::Signal<ox::Error(ox::StringViewCR path, ox::UUID const&id)> fileUpdated;
|
||||||
ox::Signal<ox::Error(ox::StringViewCR oldPath, ox::StringViewCR newPath, ox::UUID const&id)> fileMoved;
|
ox::Signal<ox::Error(ox::StringViewCR oldPath, ox::StringViewCR newPath, ox::UUID const&id)> fileMoved;
|
||||||
|
|
||||||
@ -201,6 +203,9 @@ ox::Error Project::subscribe(ProjectEvent e, ox::SignalHandler *tgt, Functor &&s
|
|||||||
connect(this, &Project::fileRecognized, tgt, slot);
|
connect(this, &Project::fileRecognized, tgt, slot);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ProjectEvent::DirDeleted:
|
||||||
|
connect(this, &Project::dirDeleted, tgt, slot);
|
||||||
|
break;
|
||||||
case ProjectEvent::FileDeleted:
|
case ProjectEvent::FileDeleted:
|
||||||
connect(this, &Project::fileDeleted, tgt, slot);
|
connect(this, &Project::fileDeleted, tgt, slot);
|
||||||
break;
|
break;
|
||||||
|
@ -93,6 +93,9 @@ void FileTreeModel::draw(turbine::Context &tctx) const noexcept {
|
|||||||
if (ImGui::IsItemActivated() || ImGui::IsItemClicked(1)) {
|
if (ImGui::IsItemActivated() || ImGui::IsItemClicked(1)) {
|
||||||
m_explorer.setSelectedNode(this);
|
m_explorer.setSelectedNode(this);
|
||||||
}
|
}
|
||||||
|
if (ImGui::IsItemFocused() && ImGui::IsKeyPressed(ImGuiKey_Delete)) {
|
||||||
|
m_explorer.fileDeleted(m_fullPath);
|
||||||
|
}
|
||||||
ig::IDStackItem const idStackItem{m_name};
|
ig::IDStackItem const idStackItem{m_name};
|
||||||
m_explorer.drawDirContextMenu(m_fullPath);
|
m_explorer.drawDirContextMenu(m_fullPath);
|
||||||
if (m_explorer.fileDraggable()) {
|
if (m_explorer.fileDraggable()) {
|
||||||
|
@ -145,7 +145,7 @@ ox::Error Project::deleteItem(ox::StringViewCR path) noexcept {
|
|||||||
}
|
}
|
||||||
auto const err = m_fs.remove(path);
|
auto const err = m_fs.remove(path);
|
||||||
if (!err) {
|
if (!err) {
|
||||||
fileDeleted.emit(path);
|
dirDeleted.emit(path);
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user