mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
[feat] let keyboard focus on input widget when needs to input password
This commit is contained in:
@@ -81,10 +81,16 @@ int Render::ConnectionStatusWindow() {
|
||||
ImGui::SetNextItemWidth(IPUT_WINDOW_WIDTH / 2);
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
|
||||
|
||||
if (focus_on_input_widget_) {
|
||||
ImGui::SetKeyboardFocusHere();
|
||||
focus_on_input_widget_ = false;
|
||||
}
|
||||
bool enter_pressed =
|
||||
ImGui::InputText("##password", (char *)remote_password_.c_str(), 7,
|
||||
ImGuiInputTextFlags_CharsNoBlank |
|
||||
ImGuiInputTextFlags_EnterReturnsTrue);
|
||||
|
||||
ImGui::PopStyleVar();
|
||||
|
||||
ImGui::SetCursorPosX(window_width * 0.315f);
|
||||
@@ -96,6 +102,7 @@ int Render::ConnectionStatusWindow() {
|
||||
show_connection_status_window_ = true;
|
||||
password_validating_ = true;
|
||||
rejoin_ = true;
|
||||
focus_on_input_widget_ = true;
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
@@ -104,6 +111,7 @@ int Render::ConnectionStatusWindow() {
|
||||
localization::cancel[localization_language_index_].c_str())) {
|
||||
remote_password_ = "";
|
||||
show_connection_status_window_ = false;
|
||||
focus_on_input_widget_ = true;
|
||||
}
|
||||
} else {
|
||||
text = localization::validate_password[localization_language_index_];
|
||||
|
||||
@@ -202,6 +202,7 @@ class Render {
|
||||
bool regenerate_password_ = false;
|
||||
bool show_about_window_ = false;
|
||||
bool show_connection_status_window_ = false;
|
||||
bool focus_on_input_widget_ = true;
|
||||
bool window_maximized_ = false;
|
||||
bool streaming_ = false;
|
||||
bool is_client_mode_ = false;
|
||||
|
||||
Reference in New Issue
Block a user