[NEW_FEATURE] Make DPI-aware for Shortcutmapper and Preference Dialog.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1174 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2014-02-12 10:14:22 +00:00
parent 7cbc342570
commit b94b9d8c61
3 changed files with 15 additions and 10 deletions

View File

@ -49,6 +49,16 @@ void ShortcutMapper::initTabs() {
TabCtrl_SetCurSel(_hTabCtrl, int(_currentState));
}
void ShortcutMapper::getClientRect(RECT & rc) const
{
Window::getClientRect(rc);
rc.top += NppParameters::getInstance()->_dpiManager.scaleY(40);
rc.bottom -= NppParameters::getInstance()->_dpiManager.scaleY(20);
rc.left += NppParameters::getInstance()->_dpiManager.scaleX(5);
}
void ShortcutMapper::translateTab(int index, const TCHAR * newname) {
if (index < 0 || index > 4)
return;

View File

@ -75,13 +75,7 @@ public:
else
::DialogBoxParam(_hInst, MAKEINTRESOURCE(IDD_SHORTCUTMAPPER_DLG), _hParent, (DLGPROC)dlgProc, (LPARAM)this);
};
void getClientRect(RECT & rc) const {
Window::getClientRect(rc);
rc.top += 40;
rc.bottom -= 20;
rc.left += 5;
};
void getClientRect(RECT & rc) const;
void translateTab(int index, const TCHAR * newname);
protected :

View File

@ -158,9 +158,10 @@ BOOL CALLBACK PreferenceDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa
makeCategoryList();
RECT rc;
getClientRect(rc);
rc.top += 10;
rc.bottom -= 50;
rc.left += 150;
rc.top += NppParameters::getInstance()->_dpiManager.scaleY(10);
rc.bottom -= NppParameters::getInstance()->_dpiManager.scaleY(50);
rc.left += NppParameters::getInstance()->_dpiManager.scaleX(150);
_barsDlg.reSizeTo(rc);
_marginsDlg.reSizeTo(rc);