Merge branch 'goldendict:master' into staged

This commit is contained in:
xiaoyifang 2022-07-30 07:35:30 +08:00 committed by GitHub
commit f8b3c9a6eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1853,21 +1853,25 @@ void MainWindow::titleChanged( ArticleView * view, QString const & title )
escaped.append( (ushort)0x202C ); // PDF, POP DIRECTIONAL FORMATTING escaped.append( (ushort)0x202C ); // PDF, POP DIRECTIONAL FORMATTING
} }
ui.tabWidget->setTabText( ui.tabWidget->indexOf( view ), escaped ); int index = ui.tabWidget->indexOf( view );
ui.tabWidget->setTabText( index, escaped );
// Set icon for "Add to Favorites" action if( index == ui.tabWidget->currentIndex() )
if( isWordPresentedInFavorites( title, cfg.lastMainGroupId ) )
{ {
addToFavorites->setIcon( blueStarIcon ); // Set icon for "Add to Favorites" action
addToFavorites->setToolTip( tr( "Remove current tab from Favorites" ) ); if( isWordPresentedInFavorites( title, cfg.lastMainGroupId ) )
} {
else addToFavorites->setIcon( blueStarIcon );
{ addToFavorites->setToolTip( tr( "Remove current tab from Favorites" ) );
addToFavorites->setIcon( starIcon ); }
addToFavorites->setToolTip( tr( "Add current tab to Favorites" ) ); else
} {
addToFavorites->setIcon( starIcon );
addToFavorites->setToolTip( tr( "Add current tab to Favorites" ) );
}
updateWindowTitle(); updateWindowTitle();
}
} }
void MainWindow::iconChanged( ArticleView * view, QIcon const & icon ) void MainWindow::iconChanged( ArticleView * view, QIcon const & icon )