Merge pull request #1599 from xiaoyifang/fix/ctrl-f-scanpopup

fix: Ctrl+F does not work in scanpopup dialog
This commit is contained in:
xiaoyifang 2024-06-21 08:26:13 +08:00 committed by GitHub
commit 10104d77aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -1942,7 +1942,7 @@ void ArticleView::openSearch()
searchPanel->lineEdit->selectAll();
// Clear any current selection
if ( !webview->selectedText().isEmpty() ) {
if ( webview->hasSelection() ) {
webview->findText( "" );
}

View file

@ -113,6 +113,7 @@ ScanPopup::ScanPopup( QWidget * parent,
connect( definition, &ArticleView::typingEvent, this, &ScanPopup::typingEvent );
openSearchAction.setShortcut( QKeySequence( "Ctrl+F" ) );
addAction( &openSearchAction );
connect( &openSearchAction, &QAction::triggered, definition, &ArticleView::openSearch );
wordListDefaultFont = ui.translateBox->completerWidget()->font();