From 79f94d5a71d92d5408995a431ed0a90deb446c32 Mon Sep 17 00:00:00 2001 From: BlueGreenMagick Date: Mon, 21 Nov 2022 09:20:00 +0900 Subject: [PATCH] fix body classes changes when changing theme (#2199) --- qt/aqt/webview.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qt/aqt/webview.py b/qt/aqt/webview.py index 2d34c7eb0..477270a51 100644 --- a/qt/aqt/webview.py +++ b/qt/aqt/webview.py @@ -708,12 +708,14 @@ html {{ {font} }} const body = document.body.classList; if ({1 if theme_manager.night_mode else 0}) {{ doc.add("night-mode"); - body.add("night-mode"); + body.add("night_mode"); body.add("nightMode"); + {"body.add('macos-dark-mode');" if theme_manager.macos_dark_mode() else ""} }} else {{ doc.remove("night-mode"); - body.remove("night-mode"); + body.remove("night_mode"); body.remove("nightMode"); + body.remove("macos-dark-mode"); }} }})(); """