From cf913e7eb5967510777c1bf55e5bf80acdee3243 Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Tue, 19 Aug 2014 21:28:00 +0800 Subject: [PATCH] libgit2 password box: If username is filled, focus password text field Signed-off-by: Sup Yut Sum --- src/TortoiseProc/UserPassword.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/TortoiseProc/UserPassword.cpp b/src/TortoiseProc/UserPassword.cpp index cd2c6ab59..6b91b7c2d 100644 --- a/src/TortoiseProc/UserPassword.cpp +++ b/src/TortoiseProc/UserPassword.cpp @@ -62,6 +62,9 @@ BOOL CUserPassword::OnInitDialog() title += m_URL; this->SetWindowText(title); } - GetDlgItem(IDC_USER_NAME)->SetFocus(); - return FALSE; // we set focus to the username textfield + if (GetDlgItem(IDC_USER_NAME)->GetWindowTextLength()) + GetDlgItem(IDC_USER_PASSWORD)->SetFocus(); + else + GetDlgItem(IDC_USER_NAME)->SetFocus(); + return FALSE; // we set focus to the username/password textfield } -- 2.11.4.GIT