mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 13:24:05 +00:00
fix: refresh webview when changed darkreader mode (#1641)
* 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>
This commit is contained in:
parent
66dd9b98f2
commit
297795a654
|
@ -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 );
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue