[studio] Make rename file accept input upon pressing Enter if text input is focused
All checks were successful
Build / build (push) Successful in 3m36s
All checks were successful
Build / build (push) Successful in 3m36s
This commit is contained in:
parent
13f0bf57e4
commit
2286238abc
@ -50,8 +50,10 @@ void RenameFile::draw(StudioContext &ctx) noexcept {
|
|||||||
ImGui::SetKeyboardFocusHere();
|
ImGui::SetKeyboardFocusHere();
|
||||||
}
|
}
|
||||||
ig::InputText("Name", m_name);
|
ig::InputText("Name", m_name);
|
||||||
|
auto const nameInputFocused = ImGui::IsItemFocused();
|
||||||
ImGui::Text("%s%s", m_path.c_str(), m_name.c_str());
|
ImGui::Text("%s%s", m_path.c_str(), m_name.c_str());
|
||||||
if (ig::PopupControlsOkCancel(m_open) == ig::PopupResponse::OK) {
|
if (ig::PopupControlsOkCancel(m_open) == ig::PopupResponse::OK ||
|
||||||
|
(nameInputFocused && ImGui::IsKeyPressed(ImGuiKey_Enter))) {
|
||||||
moveFile.emit(m_oldPath, m_path + m_name);
|
moveFile.emit(m_oldPath, m_path + m_name);
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user