mirror of
https://github.com/jmarshall23/DoomRTX.git
synced 2026-08-16 00:01:53 +02:00
Editor theme and bug fixes.
This commit is contained in:
@@ -42,6 +42,28 @@ If you have questions concerning this license or the applicable additional terms
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// NewTexWnd dark native-control helper
|
||||
// --------------------------------------------------------------------------
|
||||
static void NewTexDark_ApplyNativeTheme(HWND hWnd) {
|
||||
if (!hWnd) {
|
||||
return;
|
||||
}
|
||||
typedef HRESULT (WINAPI *SetWindowThemeProc)(HWND, LPCWSTR, LPCWSTR);
|
||||
typedef BOOL (WINAPI *AllowDarkModeForWindowProc)(HWND, BOOL);
|
||||
static HMODULE hUxTheme = ::LoadLibraryA("uxtheme.dll");
|
||||
static SetWindowThemeProc pSetWindowTheme = hUxTheme ? (SetWindowThemeProc)::GetProcAddress(hUxTheme, "SetWindowTheme") : NULL;
|
||||
static AllowDarkModeForWindowProc pAllowDarkModeForWindow = hUxTheme ? (AllowDarkModeForWindowProc)::GetProcAddress(hUxTheme, MAKEINTRESOURCEA(133)) : NULL;
|
||||
if (pAllowDarkModeForWindow) {
|
||||
pAllowDarkModeForWindow(hWnd, TRUE);
|
||||
}
|
||||
if (pSetWindowTheme) {
|
||||
pSetWindowTheme(hWnd, L"DarkMode_Explorer", NULL);
|
||||
}
|
||||
::SendMessage(hWnd, WM_THEMECHANGED, 0, 0);
|
||||
}
|
||||
/*
|
||||
=======================================================================================================================
|
||||
=======================================================================================================================
|
||||
@@ -131,6 +153,7 @@ int CNewTexWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) {
|
||||
}
|
||||
|
||||
ShowScrollBar(SB_VERT, g_PrefsDlg.m_bTextureScrollbar);
|
||||
NewTexDark_ApplyNativeTheme(GetSafeHwnd());
|
||||
m_bNeedRange = true;
|
||||
|
||||
hdcTexture = GetDC();
|
||||
@@ -170,6 +193,7 @@ void CNewTexWnd::OnParentNotify(UINT message, LPARAM lParam) {
|
||||
*/
|
||||
void CNewTexWnd::UpdatePrefs() {
|
||||
ShowScrollBar(SB_VERT, g_PrefsDlg.m_bTextureScrollbar);
|
||||
NewTexDark_ApplyNativeTheme(GetSafeHwnd());
|
||||
m_bNeedRange = true;
|
||||
Invalidate();
|
||||
UpdateWindow();
|
||||
@@ -444,6 +468,7 @@ BOOL CNewTexWnd::Create
|
||||
) {
|
||||
BOOL ret = CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
|
||||
if (ret) {
|
||||
NewTexDark_ApplyNativeTheme(GetSafeHwnd());
|
||||
hdcTexture = GetDC();
|
||||
QEW_SetupPixelFormat(hdcTexture->m_hDC, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user