From 06d0e27af6a2822877e38f0181eb8e183f4354cd Mon Sep 17 00:00:00 2001 From: oddMLan Date: Fri, 10 May 2019 09:23:41 -0700 Subject: [PATCH] [Debugger UI] Fix TLB window in HDPI configs --- .../UserInterface/Debugger/Debugger-TLB.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-TLB.cpp b/Source/Project64/UserInterface/Debugger/Debugger-TLB.cpp index 1a089533c..eecd771f8 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-TLB.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-TLB.cpp @@ -26,52 +26,53 @@ LRESULT CDebugTlb::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lPara DlgSavePos_Init(DebuggerUI_TLBPos); LV_COLUMN col; + float DPIScale = CClientDC(m_hWnd).GetDeviceCaps(LOGPIXELSX) / 96.0f; col.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; col.fmt = LVCFMT_LEFT; col.pszText = "Index"; - col.cx = 40; + col.cx = 40 * DPIScale; col.iSubItem = 0; ListView_InsertColumn(GetDlgItem(IDC_LIST), 0, &col); col.pszText = "Page Mask"; - col.cx = 90; + col.cx = 90 * DPIScale; col.iSubItem = 1; ListView_InsertColumn(GetDlgItem(IDC_LIST), 1, &col); col.pszText = "Entry Hi"; - col.cx = 90; + col.cx = 90 * DPIScale; col.iSubItem = 2; ListView_InsertColumn(GetDlgItem(IDC_LIST), 2, &col); col.pszText = "Entry Lo0"; - col.cx = 90; + col.cx = 90 * DPIScale; col.iSubItem = 3; ListView_InsertColumn(GetDlgItem(IDC_LIST), 3, &col); col.pszText = "Entry Lo1"; - col.cx = 90; + col.cx = 90 * DPIScale; col.iSubItem = 4; ListView_InsertColumn(GetDlgItem(IDC_LIST), 4, &col); col.pszText = "Index"; - col.cx = 40; + col.cx = 40 * DPIScale; col.iSubItem = 0; ListView_InsertColumn(GetDlgItem(IDC_LIST2), 0, &col); col.pszText = "Valid"; - col.cx = 40; + col.cx = 40 * DPIScale; col.iSubItem = 1; ListView_InsertColumn(GetDlgItem(IDC_LIST2), 1, &col); col.pszText = "Dirty"; - col.cx = 40; + col.cx = 40 * DPIScale; col.iSubItem = 2; ListView_InsertColumn(GetDlgItem(IDC_LIST2), 2, &col); col.pszText = "Rule"; - col.cx = 270; + col.cx = 270 * DPIScale; col.iSubItem = 3; ListView_InsertColumn(GetDlgItem(IDC_LIST2), 3, &col);