Account Settings: clear the focus of the "Sign In" button when clicked
authorOlivier Goffart <ogoffart@woboq.com>
Tue, 20 Oct 2015 11:56:35 +0000 (13:56 +0200)
committerOlivier Goffart <ogoffart@woboq.com>
Tue, 20 Oct 2015 11:56:35 +0000 (13:56 +0200)
So that the focus does not go to the "Remove Account" button instead
which would be wierd

src/gui/accountsettings.cpp

index 2df2060cf9ab97f71d2926640719ebfb7c566e7b..86d25467b3a0fd3f835dd5edacc1a8e07c3eb4f2 100644 (file)
@@ -476,6 +476,11 @@ void AccountSettings::slotAccountStateChanged(int state)
            serverWithUser = tr("%1 as <i>%2</i>").arg(server, cred->user());
         }
 
+        if (state != AccountState::SignedOut && ui->signInButton->hasFocus()) {
+            // The button is about to be hidden, clear the focus so the focus don't go to the
+            // "remove account" button
+            ui->signInButton->clearFocus();
+        }
         ui->signInButton->setVisible(state == AccountState::SignedOut);
         if (state == AccountState::Connected) {
             showConnectionLabel( tr("Connected to %1.").arg(serverWithUser) );