FIX: privacy dialog dark mode (STUDIO-2345)

Change-Id: Icd44d4b83bd9785869f68c04e6d4e38524e4b46a
This commit is contained in:
chunmao.guo 2023-03-06 16:02:57 +08:00 committed by Lane.Wei
parent a401c0fa2e
commit 7eb3aa8104
2 changed files with 11 additions and 1 deletions

View file

@ -6,7 +6,7 @@
<link rel="stylesheet" href="./main.css" />
<script src="./main.js"></script>
</head>
<body style="background-color: #F8F8F8;">
<body id = "content" style="background-color: #F8F8F8;">
<div class="container markdown-body" id="contents"></div>
</body>
<script>
@ -20,5 +20,11 @@
window.showMarkdown(encodeURIComponent(data));
});
}
function SwitchDarkMode(is_dark_mode)
{
document.getElementById("content").style.backgroundColor = is_dark_mode ? "#36363C" : "#F8F8F8";
}
</script>
</html>

View file

@ -171,6 +171,10 @@ bool PrivacyUpdateDialog::ShowReleaseNote(std::string content)
void PrivacyUpdateDialog::RunScript(std::string script)
{
WebView::RunScript(m_vebview_release_note, script);
std::string switch_dark_mode_script = "SwitchDarkMode(";
switch_dark_mode_script += wxGetApp().app_config->get("dark_color_mode") == "1" ? "true" : "false";
switch_dark_mode_script += ");";
WebView::RunScript(m_vebview_release_note, switch_dark_mode_script);
script.clear();
}