Make Shortcut mapper display correctly under high DPI
parent
7c82c523b6
commit
934c988874
|
@ -55,8 +55,22 @@ void ShortcutMapper::getClientRect(RECT & rc) const
|
||||||
{
|
{
|
||||||
Window::getClientRect(rc);
|
Window::getClientRect(rc);
|
||||||
|
|
||||||
rc.top += NppParameters::getInstance()._dpiManager.scaleY(30);
|
RECT tabRect, btnRect;
|
||||||
rc.bottom -= NppParameters::getInstance()._dpiManager.scaleY(108);
|
::GetClientRect(::GetDlgItem(_hSelf, IDC_BABYGRID_TABBAR), &tabRect);
|
||||||
|
int tabH = tabRect.bottom - tabRect.top;
|
||||||
|
int paddingTop = tabH / 2;
|
||||||
|
rc.top += tabH + paddingTop;
|
||||||
|
|
||||||
|
RECT infoRect, filterRect;
|
||||||
|
::GetClientRect(::GetDlgItem(_hSelf, IDC_BABYGRID_INFO), &infoRect);
|
||||||
|
::GetClientRect(::GetDlgItem(_hSelf, IDC_BABYGRID_FILTER), &filterRect);
|
||||||
|
::GetClientRect(::GetDlgItem(_hSelf, IDOK), &btnRect);
|
||||||
|
int infoH = infoRect.bottom - infoRect.top;
|
||||||
|
int filterH = filterRect.bottom - filterRect.top;
|
||||||
|
int btnH = btnRect.bottom - btnRect.top;
|
||||||
|
int paddingBottom = btnH;
|
||||||
|
rc.bottom -= btnH + filterH + infoH + paddingBottom;
|
||||||
|
|
||||||
rc.left += NppParameters::getInstance()._dpiManager.scaleX(5);
|
rc.left += NppParameters::getInstance()._dpiManager.scaleX(5);
|
||||||
rc.right -= NppParameters::getInstance()._dpiManager.scaleX(5);
|
rc.right -= NppParameters::getInstance()._dpiManager.scaleX(5);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,11 +29,11 @@ CAPTION "Shortcut mapper"
|
||||||
FONT 8, TEXT("MS Shell Dlg"), 400, 0, 0x1
|
FONT 8, TEXT("MS Shell Dlg"), 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
CONTROL "",IDC_BABYGRID_TABBAR,"SysTabControl32",WS_TABSTOP,4,6,384,12
|
CONTROL "",IDC_BABYGRID_TABBAR,"SysTabControl32",WS_TABSTOP,4,6,384,12
|
||||||
|
EDITTEXT IDC_BABYGRID_INFO, 4, 281, 440, 29, ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | NOT WS_TABSTOP
|
||||||
|
RTEXT "Filter :", IDC_BABYGRID_STATIC, 4, 313, 25, 12
|
||||||
|
EDITTEXT IDC_BABYGRID_FILTER, 30, 312, 415, 12, ES_AUTOHSCROLL | ES_WANTRETURN | NOT WS_BORDER, WS_EX_STATICEDGE
|
||||||
DEFPUSHBUTTON "Modify",IDM_BABYGRID_MODIFY,118,330,47,14
|
DEFPUSHBUTTON "Modify",IDM_BABYGRID_MODIFY,118,330,47,14
|
||||||
DEFPUSHBUTTON "Clear",IDM_BABYGRID_CLEAR,172,330,47,14
|
DEFPUSHBUTTON "Clear",IDM_BABYGRID_CLEAR,172,330,47,14
|
||||||
DEFPUSHBUTTON "Delete",IDM_BABYGRID_DELETE,226,330,47,14
|
DEFPUSHBUTTON "Delete",IDM_BABYGRID_DELETE,226,330,47,14
|
||||||
DEFPUSHBUTTON "Close",IDOK,280,330,47,14
|
DEFPUSHBUTTON "Close",IDOK,280,330,47,14
|
||||||
EDITTEXT IDC_BABYGRID_INFO,4,281,440,29,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | NOT WS_TABSTOP
|
|
||||||
RTEXT "Filter :",IDC_BABYGRID_STATIC,4,313,25,12
|
|
||||||
EDITTEXT IDC_BABYGRID_FILTER,30,312,415,12,ES_AUTOHSCROLL | ES_WANTRETURN | NOT WS_BORDER,WS_EX_STATICEDGE
|
|
||||||
END
|
END
|
||||||
|
|
Loading…
Reference in New Issue