From 0a8ff8b27b88ab057d2b4732abda0de590953eb5 Mon Sep 17 00:00:00 2001 From: YiFang Xiao Date: Thu, 20 Jun 2024 21:27:03 +0800 Subject: [PATCH] fix: Ctrl+F does not work in scanpopup dialog --- src/ui/articleview.cc | 2 +- src/ui/scanpopup.cc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/articleview.cc b/src/ui/articleview.cc index fa41788e..913d0209 100644 --- a/src/ui/articleview.cc +++ b/src/ui/articleview.cc @@ -1942,7 +1942,7 @@ void ArticleView::openSearch() searchPanel->lineEdit->selectAll(); // Clear any current selection - if ( !webview->selectedText().isEmpty() ) { + if ( webview->hasSelection() ) { webview->findText( "" ); } diff --git a/src/ui/scanpopup.cc b/src/ui/scanpopup.cc index 9e3009f2..ce097e24 100644 --- a/src/ui/scanpopup.cc +++ b/src/ui/scanpopup.cc @@ -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();