mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
feat: Support DWM immersive dark mode on Windows (#1636)
### Problem description Implements support for DWM immersive dark mode. Closes #1635. ### Implementation description Uses the DwmSetWindowAttribute API to enable this feature. Documentation can be found [here](https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/apply-windows-themes#enable-a-dark-mode-title-bar-for-win32-applications). ### Screenshots Before:  After:  ### Additional things Nothing.
This commit is contained in:
@@ -526,6 +526,14 @@ namespace hex {
|
||||
}
|
||||
}
|
||||
});
|
||||
RequestChangeTheme::subscribe([this](const std::string &theme) {
|
||||
const int immersiveDarkMode = 20;
|
||||
auto hwnd = glfwGetWin32Window(m_window);
|
||||
BOOL value = theme == "Dark" ? TRUE : FALSE;
|
||||
|
||||
// Using the C++ "bool" type seems to not work correctly.
|
||||
DwmSetWindowAttribute(hwnd, immersiveDarkMode, &value, sizeof(value));
|
||||
});
|
||||
|
||||
ImGui::GetIO().ConfigDebugIsDebuggerPresent = ::IsDebuggerPresent();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user