Commit 60b5ae78 authored by Alexandre Julliard's avatar Alexandre Julliard

comdlg32: Scale the listboxes in the font dialog with the font size.

parent 3e33f61c
......@@ -782,7 +782,7 @@ static LRESULT CFn_WMMeasureItem(HWND hDlg, LPARAM lParam)
/* use MAX of bitmap height and tm.tmHeight .*/
hdc=GetDC(hDlg);
if(!hdc) return 0;
hfontprev = SelectObject( hdc, GetStockObject( DEFAULT_GUI_FONT ) );
hfontprev = SelectObject( hdc, (HFONT)SendMessageW( hDlg, WM_GETFONT, 0, 0 ));
GetTextMetricsW(hdc, &tm);
if( tm.tmHeight > lpmi->itemHeight) lpmi->itemHeight = tm.tmHeight;
SelectObject(hdc, hfontprev);
......@@ -801,7 +801,7 @@ static LRESULT CFn_WMDrawItem(LPARAM lParam)
COLORREF cr, oldText=0, oldBk=0;
RECT rect;
int nFontType;
int idx;
int cx, cy, idx;
LPDRAWITEMSTRUCT lpdi = (LPDRAWITEMSTRUCT)lParam;
if (lpdi->itemID == (UINT)-1) /* got no items */
......@@ -830,9 +830,10 @@ static LRESULT CFn_WMDrawItem(LPARAM lParam)
{
case cmb1:
/* TRACE(commdlg,"WM_Drawitem cmb1\n"); */
ImageList_GetIconSize( himlTT, &cx, &cy);
SendMessageW(lpdi->hwndItem, CB_GETLBTEXT, lpdi->itemID,
(LPARAM)buffer);
TextOutW(lpdi->hDC, lpdi->rcItem.left + TTBITMAP_XSIZE + 10,
TextOutW(lpdi->hDC, lpdi->rcItem.left + cx + 4,
lpdi->rcItem.top, buffer, lstrlenW(buffer));
nFontType = SendMessageW(lpdi->hwndItem, CB_GETITEMDATA, lpdi->itemID,0L);
idx = -1;
......@@ -848,7 +849,7 @@ static LRESULT CFn_WMDrawItem(LPARAM lParam)
idx = 1; /* picture: printer */
if( idx >= 0)
ImageList_Draw( himlTT, idx, lpdi->hDC, lpdi->rcItem.left,
lpdi->rcItem.top, ILD_TRANSPARENT);
(lpdi->rcItem.top + lpdi->rcItem.bottom - cy) / 2, ILD_TRANSPARENT);
break;
case cmb2:
case cmb3:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment