Merge pull request #1034 from xiaoyifang/fix/float-lose-focuse

fix: translate line in floatable toolbar will lose focus
This commit is contained in:
xiaoyifang 2023-08-01 20:52:05 +08:00 committed by GitHub
commit 217ba5318a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2402,7 +2402,10 @@ void MainWindow::respondToTranslationRequest( QString const & word, bool checkMo
activateWindow();
}
getCurrentArticleView()->focus();
auto view = getCurrentArticleView();
view->activateWindow();
view->focus();
}
}
@ -2703,6 +2706,9 @@ void MainWindow::typingEvent( QString const & t )
ui.searchPane->activateWindow();
if ( translateLine->isEnabled() ) {
if ( navToolbar->isFloating() )
navToolbar->activateWindow();
translateLine->clear();
translateLine->setFocus();
// Escaping the typed-in characters is the user's responsibility.