[feat] cursor will move into remote id input box automaticlly if the last input remote id does not exist

This commit is contained in:
dijunkun
2024-11-21 16:20:25 +08:00
parent cb17b7c8db
commit 4fea7d86e1
3 changed files with 7 additions and 0 deletions

View File

@@ -154,6 +154,7 @@ int Render::ConnectionStatusWindow() {
localization::ok[localization_language_index_].c_str()) || localization::ok[localization_language_index_].c_str()) ||
ImGui::IsKeyPressed(ImGuiKey_Enter)) { ImGui::IsKeyPressed(ImGuiKey_Enter)) {
show_connection_status_window_ = false; show_connection_status_window_ = false;
re_enter_remote_id_ = true;
} }
} }

View File

@@ -54,6 +54,11 @@ int Render::RemoteWindow() {
ImGui::SetNextItemWidth(IPUT_WINDOW_WIDTH); ImGui::SetNextItemWidth(IPUT_WINDOW_WIDTH);
ImGui::SetWindowFontScale(1.0f); ImGui::SetWindowFontScale(1.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f); ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
if (re_enter_remote_id_) {
ImGui::SetKeyboardFocusHere();
re_enter_remote_id_ = false;
memset(remote_id_display_, 0, sizeof(remote_id_display_));
}
bool enter_pressed = ImGui::InputText( bool enter_pressed = ImGui::InputText(
"##remote_id_", remote_id_display_, IM_ARRAYSIZE(remote_id_display_), "##remote_id_", remote_id_display_, IM_ARRAYSIZE(remote_id_display_),
ImGuiInputTextFlags_CharsUppercase | ImGuiInputTextFlags_CharsUppercase |

View File

@@ -305,6 +305,7 @@ class Render {
bool show_confirm_delete_connection_ = false; bool show_confirm_delete_connection_ = false;
bool delete_connection_ = false; bool delete_connection_ = false;
bool remember_password_ = false; bool remember_password_ = false;
bool re_enter_remote_id_ = false;
double copy_start_time_ = 0; double copy_start_time_ = 0;
double regenerate_password_start_time_ = 0; double regenerate_password_start_time_ = 0;