Skip to content

Commit

Permalink
fix: refresh webview when changed darkreader mode (#1641)
Browse files Browse the repository at this point in the history
* fix: refresh webview when changed darkreader mode

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
xiaoyifang and autofix-ci[bot] authored Jul 5, 2024
1 parent 66dd9b9 commit 297795a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui/articleview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,7 @@ void ArticleView::syncBackgroundColorWithCfgDarkReader() const
// Only works Qt6.6.3+ https://bugreports.qt.io/browse/QTBUG-112013
#if QT_VERSION >= QT_VERSION_CHECK( 6, 6, 3 )
if ( cfg.preferences.darkReaderMode ) {
webview->page()->setBackgroundColor( Qt::black );
webview->page()->setBackgroundColor( QColor( 39, 40, 40 ) );
}
else {
webview->page()->setBackgroundColor( Qt::white );
Expand Down
1 change: 1 addition & 0 deletions src/ui/mainwindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2225,6 +2225,7 @@ void MainWindow::editPreferences()
auto & view = dynamic_cast< ArticleView & >( *( ui.tabWidget->widget( x ) ) );

view.setSelectionBySingleClick( p.selectWordBySingleClick );
view.syncBackgroundColorWithCfgDarkReader();
if ( needReload ) {
view.reload();
}
Expand Down

0 comments on commit 297795a

Please sign in to comment.