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:
@@ -1026,6 +1026,16 @@ static const char* CAMWND_PROP_FILTER_MASK = "QER_CamWnd_FilterMask";
|
||||
#define CAMWND_FILTER_HIDE_TARGET_LINES 0x00000020
|
||||
#define CAMWND_FILTER_HIDE_TRIGGER_BRUSHES 0x00000040
|
||||
|
||||
static const COLORREF CAMWND_DARK_PANEL = RGB(24, 27, 32);
|
||||
static const COLORREF CAMWND_DARK_MENU = RGB(28, 31, 36);
|
||||
static const COLORREF CAMWND_DARK_BORDER = RGB(58, 64, 72);
|
||||
static const COLORREF CAMWND_DARK_TEXT = RGB(226, 232, 240);
|
||||
|
||||
static HBRUSH CamWnd_DarkMenuBrush() {
|
||||
static HBRUSH hBrush = ::CreateSolidBrush(CAMWND_DARK_MENU);
|
||||
return hBrush;
|
||||
}
|
||||
|
||||
static LRESULT CALLBACK CamWnd_MenuBarProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
static int CamWnd_GetMenuHeight() {
|
||||
@@ -1292,7 +1302,7 @@ static void CamWnd_RegisterMenuBarClass() {
|
||||
wc.lpfnWndProc = CamWnd_MenuBarProc;
|
||||
wc.hInstance = AfxGetInstanceHandle();
|
||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
|
||||
wc.hbrBackground = CamWnd_DarkMenuBrush();
|
||||
wc.lpszClassName = CAMWND_MENU_BAR_CLASS;
|
||||
AfxRegisterClass(&wc);
|
||||
registered = true;
|
||||
@@ -1368,7 +1378,7 @@ static bool CamWnd_PointInMenuBar(CCamWnd* cam, const CPoint& point) {
|
||||
if (!cam || !cam->GetSafeHwnd()) {
|
||||
return false;
|
||||
}
|
||||
return point.y >= 0 && point.y < CAMWND_MENU_HEIGHT;
|
||||
return point.y >= 0 && point.y < CAMWND_TOPBAR_HEIGHT;
|
||||
}
|
||||
|
||||
static void CamWnd_UpdateRuntimeState(CCamWnd* cam, bool renderMode, bool rebuildMode, bool entityMode) {
|
||||
@@ -1932,18 +1942,18 @@ static LRESULT CALLBACK CamWnd_MenuBarProc(HWND hWnd, UINT uMsg, WPARAM wParam,
|
||||
menuRect.top = CAMWND_CAPTION_HEIGHT;
|
||||
menuRect.bottom = CAMWND_TOPBAR_HEIGHT;
|
||||
|
||||
CamWnd_FillHorizontalGradient(hDC, captionRect, RGB(24, 82, 150), RGB(92, 96, 104));
|
||||
FillRect(hDC, &menuRect, (HBRUSH)(COLOR_BTNFACE + 1));
|
||||
CamWnd_FillHorizontalGradient(hDC, captionRect, RGB(20, 36, 62), RGB(28, 31, 36));
|
||||
FillRect(hDC, &menuRect, CamWnd_DarkMenuBrush());
|
||||
|
||||
RECT dividerRect = rect;
|
||||
dividerRect.top = CAMWND_CAPTION_HEIGHT - 1;
|
||||
dividerRect.bottom = CAMWND_CAPTION_HEIGHT;
|
||||
FillRect(hDC, ÷rRect, (HBRUSH)(COLOR_3DSHADOW + 1));
|
||||
FillRect(hDC, ÷rRect, CamWnd_DarkMenuBrush());
|
||||
|
||||
RECT lineRect = rect;
|
||||
lineRect.top = CAMWND_TOPBAR_HEIGHT - 1;
|
||||
lineRect.bottom = CAMWND_TOPBAR_HEIGHT;
|
||||
FillRect(hDC, &lineRect, (HBRUSH)(COLOR_3DSHADOW + 1));
|
||||
FillRect(hDC, &lineRect, CamWnd_DarkMenuBrush());
|
||||
|
||||
HFONT font = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0);
|
||||
HFONT oldFont = NULL;
|
||||
@@ -1956,16 +1966,26 @@ static LRESULT CALLBACK CamWnd_MenuBarProc(HWND hWnd, UINT uMsg, WPARAM wParam,
|
||||
RECT captionTextRect = captionRect;
|
||||
captionTextRect.left += 8;
|
||||
captionTextRect.right -= 8;
|
||||
SetTextColor(hDC, RGB(235, 242, 255));
|
||||
SetTextColor(hDC, CAMWND_DARK_TEXT);
|
||||
DrawText(hDC, "Viewport", -1, &captionTextRect, DT_SINGLELINE | DT_LEFT | DT_VCENTER | DT_END_ELLIPSIS);
|
||||
|
||||
SetTextColor(hDC, GetSysColor(COLOR_BTNTEXT));
|
||||
SetTextColor(hDC, CAMWND_DARK_TEXT);
|
||||
|
||||
RECT itemRect;
|
||||
HBRUSH itemBrush = ::CreateSolidBrush(CAMWND_DARK_PANEL);
|
||||
HPEN borderPen = ::CreatePen(PS_SOLID, 1, CAMWND_DARK_BORDER);
|
||||
HBRUSH oldBrush = (HBRUSH)::SelectObject(hDC, itemBrush);
|
||||
HPEN oldPen = (HPEN)::SelectObject(hDC, borderPen);
|
||||
CamWnd_GetMenuItemRect(hWnd, 0, itemRect);
|
||||
RoundRect(hDC, itemRect.left + 3, itemRect.top + 2, itemRect.right - 3, itemRect.bottom - 2, 6, 6);
|
||||
DrawText(hDC, "Lighting", -1, &itemRect, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
|
||||
CamWnd_GetMenuItemRect(hWnd, 1, itemRect);
|
||||
RoundRect(hDC, itemRect.left + 3, itemRect.top + 2, itemRect.right - 3, itemRect.bottom - 2, 6, 6);
|
||||
DrawText(hDC, "Filters", -1, &itemRect, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
|
||||
::SelectObject(hDC, oldPen);
|
||||
::SelectObject(hDC, oldBrush);
|
||||
::DeleteObject(borderPen);
|
||||
::DeleteObject(itemBrush);
|
||||
|
||||
if (oldFont) {
|
||||
SelectObject(hDC, oldFont);
|
||||
|
||||
Reference in New Issue
Block a user