Zhiyi Zhang : wordpad: Use large icons for toolbar when DPI is greater than 120.
Alexandre Julliard
julliard at winehq.org
Tue Aug 17 16:26:51 CDT 2021
Module: wine
Branch: master
Commit: 766388c552a4b04fa62b3874fe841c87f6ca66ac
URL: https://source.winehq.org/git/wine.git/?a=commit;h=766388c552a4b04fa62b3874fe841c87f6ca66ac
Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date: Tue Aug 17 16:36:56 2021 +0800
wordpad: Use large icons for toolbar when DPI is greater than 120.
Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
programs/wordpad/wordpad.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c
index d48346e3c4a..e87475ad06b 100644
--- a/programs/wordpad/wordpad.c
+++ b/programs/wordpad/wordpad.c
@@ -1881,7 +1881,7 @@ static LRESULT OnCreate( HWND hWnd )
HFONT font;
HDC hdc;
SIZE name_sz, size_sz;
- int height;
+ int height, dpi;
static const WCHAR wszRichEditDll[] = {'R','I','C','H','E','D','2','0','.','D','L','L','\0'};
static const WCHAR wszRichEditText[] = {'R','i','c','h','E','d','i','t',' ','t','e','x','t','\0'};
static const WCHAR font_text[] = {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n',0}; /* a long font name */
@@ -1905,8 +1905,12 @@ static LRESULT OnCreate( HWND hWnd )
NULL, 0,
24, 24, 16, 16, sizeof(TBBUTTON));
+ hdc = GetDC(hWnd);
+ dpi = GetDeviceCaps(hdc, LOGPIXELSY);
+ ReleaseDC(hWnd, hdc);
+
ab.hInst = HINST_COMMCTRL;
- ab.nID = IDB_STD_SMALL_COLOR;
+ ab.nID = dpi >= 120 ? IDB_STD_LARGE_COLOR : IDB_STD_SMALL_COLOR;
nStdBitmaps = SendMessageW(hToolBarWnd, TB_ADDBITMAP, 0, (LPARAM)&ab);
AddButton(hToolBarWnd, nStdBitmaps+STD_FILENEW, ID_FILE_NEW);
More information about the wine-cvs
mailing list