Skip to content

Commit 0149805

Browse files
committed
allow deleting objects via database editor window
1 parent 83bc67b commit 0149805

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tsd/apps/interactive/viewer/windows/DatabaseEditor.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,17 @@ void DatabaseEditor::buildUI()
2323
ImGui::SetNextItemOpen(false, ImGuiCond_FirstUseEver);
2424
if (ImGui::CollapsingHeader(headerText, ImGuiTreeNodeFlags_None)) {
2525
tsd::foreach_item_const(ctxList, [&](auto *o) {
26-
tsd::ui::buildUI_object(*o, m_core->tsd.ctx, true);
26+
if (!o)
27+
return;
28+
29+
ImGui::Separator();
30+
31+
ImGui::PushID(o);
32+
if (ImGui::Button("delete"))
33+
m_core->tsd.ctx.removeObject(*o);
34+
else
35+
tsd::ui::buildUI_object(*o, m_core->tsd.ctx, true);
36+
ImGui::PopID();
2737
});
2838
}
2939
};

0 commit comments

Comments
 (0)