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

Alexandre Julliard julliard at winehq.org
Wed May 29 14:47:33 CDT 2013


Module: wine
Branch: master
Commit: 60b5ae785a850ee94cdff6254ec6be5abfc28936
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=60b5ae785a850ee94cdff6254ec6be5abfc28936

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed May 29 16:28:48 2013 +0200

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

---

 dlls/comdlg32/fontdlg.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/comdlg32/fontdlg.c b/dlls/comdlg32/fontdlg.c
index 25dc1e4..e5b87bf 100644
--- a/dlls/comdlg32/fontdlg.c
+++ b/dlls/comdlg32/fontdlg.c
@@ -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:




More information about the wine-cvs mailing list