[BUG_FIXED] Fix list column width and item height

This commit fixes 2 issues:
1. In Ascii Insert Panel the columns are too narrow under a high
resolution.
2. In function list panel and project panel, the item heights are
squeezed under a high resolution.
This commit is contained in:
Don Ho 2015-08-08 11:54:32 +02:00
parent 5464e62067
commit 61842a6759
2 changed files with 6 additions and 4 deletions

View File

@ -77,15 +77,15 @@ void ListView::init(HINSTANCE hInst, HWND parent)
generic_string hexStr = pNativeSpeaker->getAttrNameStr(TEXT("Hex"), "AsciiInsertion", "ColumnHex"); generic_string hexStr = pNativeSpeaker->getAttrNameStr(TEXT("Hex"), "AsciiInsertion", "ColumnHex");
generic_string charStr = pNativeSpeaker->getAttrNameStr(TEXT("Character"), "AsciiInsertion", "ColumnChar"); generic_string charStr = pNativeSpeaker->getAttrNameStr(TEXT("Character"), "AsciiInsertion", "ColumnChar");
lvColumn.cx = 45; lvColumn.cx = NppParameters::getInstance()->_dpiManager.scaleX(45);
lvColumn.pszText = (TCHAR *)valStr.c_str(); lvColumn.pszText = (TCHAR *)valStr.c_str();
ListView_InsertColumn(_hSelf, 0, &lvColumn); ListView_InsertColumn(_hSelf, 0, &lvColumn);
lvColumn.cx = 45; lvColumn.cx = NppParameters::getInstance()->_dpiManager.scaleY(45);;
lvColumn.pszText = (TCHAR *)hexStr.c_str(); lvColumn.pszText = (TCHAR *)hexStr.c_str();
ListView_InsertColumn(_hSelf, 1, &lvColumn); ListView_InsertColumn(_hSelf, 1, &lvColumn);
lvColumn.cx = 70; lvColumn.cx = NppParameters::getInstance()->_dpiManager.scaleY(70);;
lvColumn.pszText = (TCHAR *)charStr.c_str(); lvColumn.pszText = (TCHAR *)charStr.c_str();
ListView_InsertColumn(_hSelf, 2, &lvColumn); ListView_InsertColumn(_hSelf, 2, &lvColumn);
} }

View File

@ -28,6 +28,7 @@
#include "TreeView.h" #include "TreeView.h"
#include "Parameters.h"
#define CY_ITEMHEIGHT 18 #define CY_ITEMHEIGHT 18
@ -47,7 +48,8 @@ void TreeView::init(HINSTANCE hInst, HWND parent, int treeViewID)
_hInst, _hInst,
(LPVOID)0); (LPVOID)0);
TreeView_SetItemHeight(_hSelf, CY_ITEMHEIGHT); int itemHeight = NppParameters::getInstance()->_dpiManager.scaleY(CY_ITEMHEIGHT);
TreeView_SetItemHeight(_hSelf, itemHeight);
::SetWindowLongPtr(_hSelf, GWLP_USERDATA, (LONG_PTR)this); ::SetWindowLongPtr(_hSelf, GWLP_USERDATA, (LONG_PTR)this);
_defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWLP_WNDPROC, (LONG_PTR)staticProc)); _defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWLP_WNDPROC, (LONG_PTR)staticProc));