fix: Ctrl+F does not work in scanpopup dialog

This commit is contained in:
YiFang Xiao 2024-06-20 21:27:03 +08:00
parent da32be687c
commit 0a8ff8b27b
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();