1
0
mirror of synced 2025-02-07 14:41:21 +01:00

ui: Improved command palette

This commit is contained in:
WerWolv 2021-10-07 16:25:59 +02:00
parent a67263fa27
commit 2e05845410
2 changed files with 7 additions and 2 deletions

View File

@ -28,9 +28,9 @@ namespace hex::plugin::builtin {
if (result.has_value()) if (result.has_value())
return hex::format("#{0} = %{1}", input.data(), result.value()); return hex::format("#{0} = {1}", input.data(), result.value());
else else
return hex::format("#{0} = ???", input.data()); return std::string("???");
}); });
ContentRegistry::CommandPaletteCommands::add( ContentRegistry::CommandPaletteCommands::add(

View File

@ -45,6 +45,11 @@ namespace hex {
} }
if (this->m_focusInputTextBox) { if (this->m_focusInputTextBox) {
auto textState = ImGui::GetInputTextState(ImGui::GetID("##command_input"));
if (textState != nullptr) {
textState->Stb.cursor = strlen(this->m_commandBuffer.data());
}
ImGui::SetKeyboardFocusHere(0); ImGui::SetKeyboardFocusHere(0);
this->m_focusInputTextBox = false; this->m_focusInputTextBox = false;
} }