From 92074703051d22bf7bc8bc63fbe7cd3bdd46ef25 Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Tue, 19 May 2015 22:31:12 +0800 Subject: [PATCH] Make Settings dialog treeview width scale according to DPI Signed-off-by: Sup Yut Sum --- src/Utils/TreePropSheet/TreePropSheet.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Utils/TreePropSheet/TreePropSheet.cpp b/src/Utils/TreePropSheet/TreePropSheet.cpp index 841864d34..0972825c8 100644 --- a/src/Utils/TreePropSheet/TreePropSheet.cpp +++ b/src/Utils/TreePropSheet/TreePropSheet.cpp @@ -784,7 +784,10 @@ BOOL CTreePropSheet::OnInitDialog() m_pFrame->ShowCaption(m_bPageCaption); // Lets make place for the tree ctrl - const int nTreeWidth = m_nPageTreeWidth; + HDC hdc = ::GetDC(nullptr); + int dpiX = GetDeviceCaps(hdc, LOGPIXELSX); + ::ReleaseDC(nullptr, hdc); + const int nTreeWidth = m_nPageTreeWidth * dpiX / 96; const int nTreeSpace = 5; CRect rectSheet; -- 2.11.4.GIT