diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 36a4768b9..0915e35bf 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -997,6 +997,19 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA SendMessage(hDirCombo, WM_SETFONT, (WPARAM)_hMonospaceFont, MAKELPARAM(true, 0)); } + // Change ComboBox height to accomodate High-DPI settings. + // ComboBoxes are scaled using the font used in them, however this results in weird optics + // on scaling > 200% (192 DPI). Using this method we accomodate these scalings way better + // than the OS does with the current dpiAware.manifest... + for (HWND hComboBox : { hFindCombo, hReplaceCombo, hFiltersCombo, hDirCombo }) + { + LOGFONT lf = {}; + HFONT font = reinterpret_cast(SendMessage(hComboBox, WM_GETFONT, 0, 0)); + ::GetObject(font, sizeof(lf), &lf); + lf.lfHeight = (NppParameters::getInstance()._dpiManager.scaleY(16) - 5) * -1; + SendMessage(hComboBox, WM_SETFONT, (WPARAM)CreateFontIndirect(&lf), MAKELPARAM(true, 0)); + } + RECT arc; ::GetWindowRect(::GetDlgItem(_hSelf, IDCANCEL), &arc); _markClosePos.bottom = _findInFilesClosePos.bottom = _replaceClosePos.bottom = _findClosePos.bottom = arc.bottom - arc.top; diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.rc b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.rc index 4d6657a3e..a3387c2a0 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.rc +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.rc @@ -24,16 +24,16 @@ EXSTYLE WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE CAPTION "Replace" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - RTEXT "&Find what :",IDFINDWHAT_STATIC,1,21,75,8 + RTEXT "&Find what :",IDFINDWHAT_STATIC,1,22,73,8 COMBOBOX IDFINDWHAT,76,20,170,150,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP - RTEXT "Rep&lace with :",ID_STATICTEXT_REPLACE,1,39,75,8 + RTEXT "Rep&lace with :",ID_STATICTEXT_REPLACE,1,40,73,8 COMBOBOX IDREPLACEWITH,76,38,170,50,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP - PUSHBUTTON "",IDD_FINDREPLACE_SWAP_BUTTON,249,26,13,17 - RTEXT "Filter&s :",IDD_FINDINFILES_FILTERS_STATIC,1,57,75,8, SS_NOTIFY + PUSHBUTTON "",IDD_FINDREPLACE_SWAP_BUTTON,248,27,16,17 + RTEXT "Filter&s :",IDD_FINDINFILES_FILTERS_STATIC,1,58,73,8, SS_NOTIFY COMBOBOX IDD_FINDINFILES_FILTERS_COMBO,76,56,170,150,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP - RTEXT "Dir&ectory :",IDD_FINDINFILES_DIR_STATIC,7,75,40,8 - COMBOBOX IDD_FINDINFILES_DIR_COMBO,49,74,190,150,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP - PUSHBUTTON "...",IDD_FINDINFILES_BROWSE_BUTTON,245,73,15,13 + RTEXT "Dir&ectory :",IDD_FINDINFILES_DIR_STATIC,7,76,41,8 + COMBOBOX IDD_FINDINFILES_DIR_COMBO,50,74,196,150,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_TABSTOP + PUSHBUTTON "...",IDD_FINDINFILES_BROWSE_BUTTON,248,73,16,14 CONTROL "Follow current doc.",IDD_FINDINFILES_FOLDERFOLLOWSDOC_CHECK, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,270,73,94,15 CONTROL "In all su&b-folders",IDD_FINDINFILES_RECURSIVE_CHECK,