Editor theme and bug fixes.

This commit is contained in:
Justin Marshall
2026-05-15 10:32:24 -07:00
parent ea14ecb595
commit f6b489b2ff
18 changed files with 5972 additions and 455 deletions
+25
View File
@@ -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);
}