Module: wine Branch: master Commit: 3a59a4d1cd5f03c9ed92f09023f816a18a0b1b70 URL: https://gitlab.winehq.org/wine/wine/-/commit/3a59a4d1cd5f03c9ed92f09023f816a...
Author: Jactry Zeng jzeng@codeweavers.com Date: Thu May 18 02:02:52 2023 -0500
comdlg32: Set a size for toolbar buttons of the file access dialog.
The default size is too small for HiDPI, so set the same height as the look-in combo box to it. And since in owner draw mode, the height of combo box is calculated and updated when drawing items, this patch set button height for toolbar from FILEDLG95_LOOKIN_DrawItem() too.
---
dlls/comdlg32/filedlg.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index 415c0580461..acb9b4f35a4 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -180,7 +180,7 @@ static void FILEDLG95_FILETYPE_Clean(HWND hwnd);
/* Functions used by the Look In combo box */ static void FILEDLG95_LOOKIN_Init(HWND hwndCombo); -static LRESULT FILEDLG95_LOOKIN_DrawItem(LPDRAWITEMSTRUCT pDIStruct); +static LRESULT FILEDLG95_LOOKIN_DrawItem(HWND hwnd, LPDRAWITEMSTRUCT pDIStruct); static BOOL FILEDLG95_LOOKIN_OnCommand(HWND hwnd, WORD wNotifyCode); static int FILEDLG95_LOOKIN_AddItem(HWND hwnd,LPITEMIDLIST pidl, int iInsertId); static int FILEDLG95_LOOKIN_SearchItem(HWND hwnd,WPARAM searchArg,int iSearchMethod); @@ -1392,7 +1392,7 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l switch(((LPDRAWITEMSTRUCT)lParam)->CtlID) { case IDC_LOOKIN: - FILEDLG95_LOOKIN_DrawItem((LPDRAWITEMSTRUCT) lParam); + FILEDLG95_LOOKIN_DrawItem(hwnd, (LPDRAWITEMSTRUCT)lParam); return TRUE; } } @@ -3368,13 +3368,12 @@ static void FILEDLG95_LOOKIN_Init(HWND hwndCombo) * * WM_DRAWITEM message handler */ -static LRESULT FILEDLG95_LOOKIN_DrawItem(LPDRAWITEMSTRUCT pDIStruct) +static LRESULT FILEDLG95_LOOKIN_DrawItem(HWND hwnd, LPDRAWITEMSTRUCT pDIStruct) { COLORREF crWin = GetSysColor(COLOR_WINDOW); COLORREF crHighLight = GetSysColor(COLOR_HIGHLIGHT); COLORREF crText = GetSysColor(COLOR_WINDOWTEXT); - RECT rectText; - RECT rectIcon; + RECT rectText, rectIcon, lookin_rect; SHFILEINFOW sfi; HIMAGELIST ilItemImage; int iIndentation; @@ -3382,6 +3381,8 @@ static LRESULT FILEDLG95_LOOKIN_DrawItem(LPDRAWITEMSTRUCT pDIStruct) LPSFOLDER tmpFolder; UINT shgfi_flags = SHGFI_PIDL | SHGFI_OPENICON | SHGFI_SYSICONINDEX | SHGFI_DISPLAYNAME; UINT icon_width, icon_height; + FileOpenDlgInfos *dialog; + int height;
TRACE("\n");
@@ -3452,6 +3453,12 @@ static LRESULT FILEDLG95_LOOKIN_DrawItem(LPDRAWITEMSTRUCT pDIStruct)
/* Draw the associated text */ TextOutW(pDIStruct->hDC,rectText.left,rectText.top,sfi.szDisplayName,lstrlenW(sfi.szDisplayName)); + + dialog = get_filedlg_infoptr(hwnd); + GetWindowRect(dialog->DlgInfos.hwndLookInCB, &lookin_rect); + height = lookin_rect.bottom - lookin_rect.top; + SendMessageW(dialog->DlgInfos.hwndTB, TB_SETBUTTONSIZE, 0, MAKELPARAM(height, height)); + return NOERROR; }