Add option to enable experimental dark mode

This commit is contained in:
sepro 2023-07-24 23:25:44 +02:00 committed by arch1t3cht
parent 5944d7999c
commit 061a860e2e
3 changed files with 13 additions and 1 deletions

View File

@ -16,7 +16,8 @@
"Save Charset" : "UTF-8",
"Save UI State" : true,
"Show Toolbar" : true,
"Toolbar Icon Size" : 16
"Toolbar Icon Size" : 16,
"Dark Mode" : false
},

View File

@ -224,6 +224,12 @@ bool AegisubApp::OnInit() {
}
#endif
#if defined(__WXMSW__) && wxVERSION_NUMBER >= 3300
if (OPT_GET("App/Dark Mode")->GetBool()) {
MSWEnableDarkMode(wxApp::DarkMode_Always);
}
#endif
// Init commands.
cmd::init_builtin_commands();

View File

@ -228,6 +228,11 @@ void Interface(wxTreebook *book, Preferences *parent) {
auto tl_assistant = p->PageSizer(_("Translation Assistant"));
p->OptionAdd(tl_assistant, _("Skip over whitespace"), "Tool/Translation Assistant/Skip Whitespace");
#if defined(__WXMSW__) && wxVERSION_NUMBER >= 3300
auto dark_mode = p->PageSizer(_("Dark Mode"));
p->OptionAdd(dark_mode, _("Enable experimental dark mode (restart required)"), "App/Dark Mode");
#endif
p->SetSizerAndFit(p->sizer);
}