Merge pull request #1729 from xiaoyifang/opt/double-click-in-welcome-page

opt: double click in welcome page
This commit is contained in:
xiaoyifang 2024-08-21 13:49:18 +08:00 committed by GitHub
commit da1c67c35d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2005,12 +2005,16 @@ void ArticleView::doubleClicked( QPoint pos )
else { else {
QUrl const & ref = webview->url(); QUrl const & ref = webview->url();
auto groupId = getGroup( ref );
if ( groupId == 0 || groupId == Instances::Group::HelpGroupId ) {
groupId = currentGroupId;
}
if ( Utils::Url::hasQueryItem( ref, "dictionaries" ) ) { if ( Utils::Url::hasQueryItem( ref, "dictionaries" ) ) {
QStringList dictsList = Utils::Url::queryItemValue( ref, "dictionaries" ).split( ",", Qt::SkipEmptyParts ); QStringList dictsList = Utils::Url::queryItemValue( ref, "dictionaries" ).split( ",", Qt::SkipEmptyParts );
showDefinition( selectedText, dictsList, getGroup( ref ), false ); showDefinition( selectedText, dictsList, groupId, false );
} }
else else
showDefinition( selectedText, getGroup( ref ), getCurrentArticle() ); showDefinition( selectedText, groupId, getCurrentArticle() );
} }
} }
} }