Squashed 'deps/nostalgia/' changes from 26fe266b..0de428a2
0de428a2 [studio/applib] Cleanup 8a52df4f [nostalgia/gfx] More cleanup efec6eb3 [nostalgia/gfx/studio/palette] Add RGB key shortcuts for focusing color channels 56eeb249 [nostalgia/gfx/opengl] More cleanup ae81f6b3 [ox/std] Make Span::operator[] const c1108301 [nostalgia/gfx] Cleanup 83fbe6ac [keel,turbine,studio] Fix some install mistakes 80b45283 [nostalgia/gfx] Cleanup 0fa39433 [nostalgia] Add release note about Mac menubar using Cmd cae75350 [nostalgia] Fix typos in release notes df878323 [studio] Add build date to About d585794c [nostalgia/gfx/studio/tilesheet] Fix Insert tile command 20965854 [nostalgia/gfx/studio/tilesheet] Cleanup 02383a4a [ox/std] Cleanup 185a7628 [nostalgia] Make pkg-dmg delete bundle after archive created b722b4f7 [nostalgia] Update release notes 459ab5aa [studio] Remove ability to re-order Editor tabs 565f621c [nostalgia/gfx/studio/tilesheet] Fix Delete Tile functionality 9589ca91 [keel] Cleanup 164db500 [keel] Cleanup cbfb167d [nostalgia] Remove unused project directory e7b83be8 [nostalgia] Update release notes 649da5fc [nostalgia/sample_project] Delete Scenes directory aa095f76 [studio] Make Delete key initiate deletion of selected directory bb99c99f [studio] Make deleting a directory close files in that directory 7f0dcdd2 [nostalgia/gfx/studio/tilesheet] Cleanup 6029ad5d [nostalgia/studio] Add command for bundling Mac app git-subtree-dir: deps/nostalgia git-subtree-split: 0de428a2e588d3360b98aa7e00c2498d5a54019b
This commit is contained in:
@@ -23,6 +23,7 @@ enum class ProjectEvent {
|
||||
// FileRecognized is triggered for all matching files upon a new
|
||||
// subscription to a section of the project and upon the addition of a file.
|
||||
FileRecognized,
|
||||
DirDeleted,
|
||||
FileDeleted,
|
||||
FileUpdated,
|
||||
FileMoved,
|
||||
@@ -134,6 +135,7 @@ class Project: public ox::SignalHandler {
|
||||
// file.
|
||||
ox::Signal<ox::Error(ox::StringViewCR)> fileRecognized;
|
||||
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 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);
|
||||
break;
|
||||
}
|
||||
case ProjectEvent::DirDeleted:
|
||||
connect(this, &Project::dirDeleted, tgt, slot);
|
||||
break;
|
||||
case ProjectEvent::FileDeleted:
|
||||
connect(this, &Project::fileDeleted, tgt, slot);
|
||||
break;
|
||||
|
@@ -44,5 +44,5 @@ install(
|
||||
DIRECTORY
|
||||
../include/studio
|
||||
DESTINATION
|
||||
include/studio
|
||||
include
|
||||
)
|
||||
|
@@ -93,6 +93,9 @@ void FileTreeModel::draw(turbine::Context &tctx) const noexcept {
|
||||
if (ImGui::IsItemActivated() || ImGui::IsItemClicked(1)) {
|
||||
m_explorer.setSelectedNode(this);
|
||||
}
|
||||
if (ImGui::IsItemFocused() && ImGui::IsKeyPressed(ImGuiKey_Delete)) {
|
||||
m_explorer.fileDeleted(m_fullPath);
|
||||
}
|
||||
ig::IDStackItem const idStackItem{m_name};
|
||||
m_explorer.drawDirContextMenu(m_fullPath);
|
||||
if (m_explorer.fileDraggable()) {
|
||||
|
@@ -145,7 +145,7 @@ ox::Error Project::deleteItem(ox::StringViewCR path) noexcept {
|
||||
}
|
||||
auto const err = m_fs.remove(path);
|
||||
if (!err) {
|
||||
fileDeleted.emit(path);
|
||||
dirDeleted.emit(path);
|
||||
}
|
||||
return err;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user