[studio] Cleanup
This commit is contained in:
parent
7b638538aa
commit
d54e93d836
@ -39,13 +39,15 @@ void NewDir::draw(StudioContext &ctx) noexcept {
|
||||
case Stage::Opening:
|
||||
ImGui::OpenPopup(title().c_str());
|
||||
m_open = true;
|
||||
m_stage = Stage::Open;
|
||||
[[fallthrough]];
|
||||
case Stage::Open:
|
||||
drawWindow(ctx.tctx, m_open, [this] {
|
||||
if (m_stage == Stage::Opening) {
|
||||
if (ImGui::IsWindowAppearing()) {
|
||||
ImGui::SetKeyboardFocusHere();
|
||||
}
|
||||
ig::InputText("Name", m_str);
|
||||
ImGui::SetItemDefaultFocus();
|
||||
if (ImGui::IsItemFocused() && ImGui::IsKeyPressed(ImGuiKey_Enter)) {
|
||||
newDir.emit(m_path + "/" + m_str);
|
||||
close();
|
||||
@ -55,7 +57,6 @@ void NewDir::draw(StudioContext &ctx) noexcept {
|
||||
close();
|
||||
}
|
||||
});
|
||||
m_stage = Stage::Open;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user