diff --git a/Pepper/Pepper.vcxproj b/Pepper/Pepper.vcxproj index c62bb56..1a4eb2f 100644 --- a/Pepper/Pepper.vcxproj +++ b/Pepper/Pepper.vcxproj @@ -160,8 +160,9 @@ - - + + + diff --git a/Pepper/Pepper.vcxproj.filters b/Pepper/Pepper.vcxproj.filters index 4b1079f..d165ee2 100644 --- a/Pepper/Pepper.vcxproj.filters +++ b/Pepper/Pepper.vcxproj.filters @@ -115,10 +115,13 @@ Resource Files - + Resource Files - + + Resource Files + + Resource Files diff --git a/Pepper/ViewLeft.cpp b/Pepper/ViewLeft.cpp index c0bf605..5b99b5c 100644 --- a/Pepper/ViewLeft.cpp +++ b/Pepper/ViewLeft.cpp @@ -29,9 +29,15 @@ void CViewLeft::OnInitialUpdate() if (m_pLibpe->GetImageInfo(dwFileInfo) != S_OK) return; - m_ImgListRootTree.Create(16, 16, ILC_COLORDDB, 0, 2); - const int iconHdr = m_ImgListRootTree.Add(AfxGetApp()->LoadIconW(IDI_TREE_MAIN_HEADER_ICON)); - const int iconDirs = m_ImgListRootTree.Add(AfxGetApp()->LoadIconW(IDI_TREE_MAIN_DIR_ICON)); + //Scaling factor for HighDPI displays. + auto pDC = GetDC(); + const auto fScale = GetDeviceCaps(pDC->m_hDC, LOGPIXELSY) / 96.0f; + ReleaseDC(pDC); + const auto iImgSize = static_cast(16 * fScale); + + m_ImgListRootTree.Create(iImgSize, iImgSize, ILC_COLOR32, 0, 2); + const int iconHdr = m_ImgListRootTree.Add(AfxGetApp()->LoadIconW(IDI_TREE_PEHEADER)); + const int iconDirs = m_ImgListRootTree.Add(AfxGetApp()->LoadIconW(IDI_TREE_PEDIRS)); CRect rect; GetClientRect(&rect); @@ -185,7 +191,7 @@ BOOL CViewLeft::OnEraseBkgnd(CDC* /*pDC*/) void CViewLeft::OnSize(UINT nType, int cx, int cy) { CView::OnSize(nType, cx, cy); - + if (m_fCreated) m_stTreeMain.SetWindowPos(this, 0, 0, cx, cy, SWP_NOACTIVATE | SWP_NOZORDER); } \ No newline at end of file diff --git a/Pepper/ViewRightBL.cpp b/Pepper/ViewRightBL.cpp index d796f1a..490ffd1 100644 --- a/Pepper/ViewRightBL.cpp +++ b/Pepper/ViewRightBL.cpp @@ -775,8 +775,14 @@ int CViewRightBL::CreateTreeResources() WCHAR wstr[MAX_PATH]; - m_imglTreeRes.Create(16, 16, ILC_COLOR32, 0, 4); - const int iconDirs = m_imglTreeRes.Add(AfxGetApp()->LoadIconW(IDI_TREE_MAIN_DIR_ICON)); + //Scaling factor for HighDPI displays. + auto pDC = GetDC(); + const auto fScale = GetDeviceCaps(pDC->m_hDC, LOGPIXELSY) / 96.0f; + ReleaseDC(pDC); + const auto iImgSize = static_cast(16 * fScale); + + m_imglTreeRes.Create(iImgSize, iImgSize, ILC_COLOR32, 0, 4); + const auto iconDirs = m_imglTreeRes.Add(AfxGetApp()->LoadIconW(IDI_TREE_PERESOURCE)); m_treeResBottom.SetImageList(&m_imglTreeRes, TVSIL_NORMAL); long ilvlRoot = 0; diff --git a/Pepper/include/Utility.h b/Pepper/include/Utility.h index c807856..be507f3 100644 --- a/Pepper/include/Utility.h +++ b/Pepper/include/Utility.h @@ -6,8 +6,8 @@ #define PRODUCT_DESC L"PE files viewer, github.com/jovibor/Pepper" #define COPYRIGHT_NAME L"(C) Jovibor 2019-2021" #define MAJOR_VERSION 1 -#define MINOR_VERSION 2 -#define MAINTENANCE_VERSION 6 +#define MINOR_VERSION 3 +#define MAINTENANCE_VERSION 0 #define TO_WSTR_HELPER(x) L## #x #define TO_WSTR(x) TO_WSTR_HELPER(x) diff --git a/Pepper/res/IDI_TREE_PEDIRS.ico b/Pepper/res/IDI_TREE_PEDIRS.ico new file mode 100644 index 0000000..265ca23 Binary files /dev/null and b/Pepper/res/IDI_TREE_PEDIRS.ico differ diff --git a/Pepper/res/IDI_TREE_PEHEADER.ico b/Pepper/res/IDI_TREE_PEHEADER.ico new file mode 100644 index 0000000..090c577 Binary files /dev/null and b/Pepper/res/IDI_TREE_PEHEADER.ico differ diff --git a/Pepper/res/IDI_TREE_PERESOURCE.ico b/Pepper/res/IDI_TREE_PERESOURCE.ico new file mode 100644 index 0000000..e7a3763 Binary files /dev/null and b/Pepper/res/IDI_TREE_PERESOURCE.ico differ diff --git a/Pepper/res/Pepper.rc b/Pepper/res/Pepper.rc index 37267a1..aa86a34 100644 --- a/Pepper/res/Pepper.rc +++ b/Pepper/res/Pepper.rc @@ -71,9 +71,11 @@ END // remains consistent on all systems. IDR_MAINFRAME ICON "Pepper.ico" -IDI_TREE_MAIN_HEADER_ICON ICON "TreeMain_Header.ico" +IDI_TREE_PEHEADER ICON "IDI_TREE_PEHEADER.ico" -IDI_TREE_MAIN_DIR_ICON ICON "TreeMain_Dirs.ico" +IDI_TREE_PEDIRS ICON "IDI_TREE_PEDIRS.ico" + +IDI_TREE_PERESOURCE ICON "IDI_TREE_PERESOURCE.ico" ///////////////////////////////////////////////////////////////////////////// diff --git a/Pepper/res/TreeMain_Dirs.ico b/Pepper/res/TreeMain_Dirs.ico deleted file mode 100644 index ab930c9..0000000 Binary files a/Pepper/res/TreeMain_Dirs.ico and /dev/null differ diff --git a/Pepper/res/TreeMain_Header.ico b/Pepper/res/TreeMain_Header.ico deleted file mode 100644 index 84f5753..0000000 Binary files a/Pepper/res/TreeMain_Header.ico and /dev/null differ diff --git a/Pepper/res/resource.h b/Pepper/res/resource.h index ab38f89..5a7356f 100644 --- a/Pepper/res/resource.h +++ b/Pepper/res/resource.h @@ -15,8 +15,9 @@ #define IDR_PepperTYPE 130 #define ID_WINDOW_MANAGER 131 #define IDS_EDIT_MENU 306 -#define IDI_TREE_MAIN_HEADER_ICON 314 -#define IDI_TREE_MAIN_DIR_ICON 315 +#define IDI_TREE_PEHEADER 314 +#define IDI_TREE_PEDIRS 315 +#define IDI_TREE_PERESOURCE 318 #define IDC_LINK_PEPPER 1006 #define IDC_LINK_LIBPE 1007 #define IDC_LINK_HEXCTRL 1008 @@ -35,7 +36,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 318 +#define _APS_NEXT_RESOURCE_VALUE 319 #define _APS_NEXT_COMMAND_VALUE 32798 #define _APS_NEXT_CONTROL_VALUE 1010 #define _APS_NEXT_SYMED_VALUE 310