File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -175,17 +175,19 @@ void MainWindow::updatePageTheme() {
175
175
176
176
QString windowTheme = settings.value (" windowTheme" , " light" ).toString ();
177
177
178
- if (windowTheme == " dark" ){
179
- webEngine->page ()->runJavaScript (" localStorage['system-theme-mode']='false'; localStorage.theme='\" dark\" '; " );
180
- }else {
181
- webEngine->page ()->runJavaScript (" localStorage['system-theme-mode']='false'; localStorage.theme='\" light\" '; " );
182
- }
183
-
184
178
if (windowTheme == " dark" ) {
179
+ webEngine->page ()->runJavaScript (
180
+ " localStorage['system-theme-mode']='false'; "
181
+ " localStorage.theme='\" dark\" '; " );
182
+
185
183
webEngine->page ()->runJavaScript (
186
184
" document.querySelector('body').classList.add('" + windowTheme +
187
185
" ');" );
188
186
} else {
187
+ webEngine->page ()->runJavaScript (
188
+ " localStorage['system-theme-mode']='false'; "
189
+ " localStorage.theme='\" light\" '; " );
190
+
189
191
webEngine->page ()->runJavaScript (
190
192
" document.querySelector('body').classList.remove('dark');" );
191
193
}
@@ -958,7 +960,7 @@ void MainWindow::handleWebViewTitleChanged(QString title) {
958
960
959
961
void MainWindow::handleLoadFinished (bool loaded) {
960
962
if (loaded) {
961
- qDebug ()<< " Loaded" ;
963
+ qDebug () << " Loaded" ;
962
964
checkLoadedCorrectly ();
963
965
updatePageTheme ();
964
966
handleZoom ();
You can’t perform that action at this time.
0 commit comments