Support for Windows dark mode and force option WIP
Use the new experimental wxWidgets API for dark mode on Windows. Also add an option to force dark mode on all platforms. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
7e1afcd37c
commit
08665c36c6
File diff suppressed because it is too large
Load Diff
|
@ -348,6 +348,7 @@ std::array<Option, kNbOptions>& Option::All() {
|
|||
Option(OptionID::kUIAllowJoystickBackgroundInput, &g_owned_opts.allow_joystick_background_input),
|
||||
Option(OptionID::kUIHideMenuBar, &gopts.hide_menu_bar),
|
||||
Option(OptionID::kUISuspendScreenSaver, &gopts.suspend_screensaver),
|
||||
Option(OptionID::kUIForceDarkMode, &gopts.force_dark_mode),
|
||||
|
||||
/// Sound
|
||||
Option(OptionID::kSoundAudioAPI, &gopts.audio_api),
|
||||
|
|
|
@ -116,6 +116,7 @@ enum class OptionID {
|
|||
kUIAllowJoystickBackgroundInput,
|
||||
kUIHideMenuBar,
|
||||
kUISuspendScreenSaver,
|
||||
kUIForceDarkMode,
|
||||
|
||||
/// Sound
|
||||
kSoundAudioAPI,
|
||||
|
|
|
@ -120,6 +120,7 @@ static constexpr std::array<Option::Type, kNbOptions> kOptionsTypes = {
|
|||
/*kUIAllowJoystickBackgroundInput*/ Option::Type::kBool,
|
||||
/*kUIHideMenuBar*/ Option::Type::kBool,
|
||||
/*kUISuspendScreenSaver*/ Option::Type::kBool,
|
||||
/*kUIForceDarkMode*/ Option::Type::kBool,
|
||||
|
||||
/// Sound
|
||||
/*kSoundAudioAPI*/ Option::Type::kAudioApi,
|
||||
|
|
|
@ -2622,6 +2622,7 @@ bool MainFrame::BindControls()
|
|||
cb->Hide();
|
||||
#endif // !HAVE_XSS
|
||||
}
|
||||
{ getcbb("ForceDarkMode", gopts.force_dark_mode); }
|
||||
wxFilePickerCtrl* fp;
|
||||
#define getfp(n, o, l) \
|
||||
do { \
|
||||
|
|
|
@ -72,6 +72,7 @@ extern struct opts_t {
|
|||
/// UI Config
|
||||
bool hide_menu_bar = true;
|
||||
bool suspend_screensaver = false;
|
||||
bool force_dark_mode = false;
|
||||
|
||||
/// wxWindows
|
||||
// wxWidgets-generated options (opaque)
|
||||
|
|
|
@ -434,6 +434,11 @@ bool wxvbamApp::OnInit() {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(__WXMSW__) && wxCHECK_VERSION(3, 2, 3)
|
||||
if (wxSystemAppearance::IsSystemDark())
|
||||
MSWEnableDarkMode();
|
||||
#endif
|
||||
|
||||
// process command-line options
|
||||
for (size_t i = 0; i < pending_optset.size(); i++) {
|
||||
auto parts = strutils::split(pending_optset[i], wxT('='));
|
||||
|
|
|
@ -18,6 +18,13 @@
|
|||
<flag>wxALL</flag>
|
||||
<border>5</border>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="wxCheckBox" name="ForceDarkMode">
|
||||
<label>Force Dark Mode (requires restart)</label>
|
||||
</object>
|
||||
<flag>wxALL</flag>
|
||||
<border>5</border>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<flag>wxALL|wxEXPAND</flag>
|
||||
<border>5</border>
|
||||
|
|
Loading…
Reference in New Issue