1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[ui] fix issues with the Info field

* Make the field a tab stop for screen readers
* Ensure the font is consistent
* Clip text so that it doesn't overflow
* Closes #503
This commit is contained in:
Pete Batard 2015-05-21 23:51:48 +01:00
parent c84075385e
commit cf391d693d
2 changed files with 21 additions and 18 deletions

View file

@ -112,7 +112,8 @@ static loc_cmd* selected_locale = NULL;
static UINT_PTR UM_LANGUAGE_MENU_MAX = UM_LANGUAGE_MENU; static UINT_PTR UM_LANGUAGE_MENU_MAX = UM_LANGUAGE_MENU;
static RECT relaunch_rc = { -65536, -65536, 0, 0}; static RECT relaunch_rc = { -65536, -65536, 0, 0};
static UINT uBootChecked = BST_CHECKED, uQFChecked = BST_CHECKED, uMBRChecked = BST_UNCHECKED; static UINT uBootChecked = BST_CHECKED, uQFChecked = BST_CHECKED, uMBRChecked = BST_UNCHECKED;
static HFONT hFont; static HFONT hInfoFont;
static HBRUSH hInfoBrush;
static WNDPROC info_original_proc = NULL; static WNDPROC info_original_proc = NULL;
char ClusterSizeLabel[MAX_CLUSTER_SIZES][64]; char ClusterSizeLabel[MAX_CLUSTER_SIZES][64];
char msgbox[1024], msgbox_title[32], *ini_file = NULL; char msgbox[1024], msgbox_title[32], *ini_file = NULL;
@ -1539,13 +1540,13 @@ static INT_PTR CALLBACK InfoCallback(HWND hCtrl, UINT message, WPARAM wParam, LP
case WM_PAINT: case WM_PAINT:
GetWindowTextW(hInfo, winfo, ARRAYSIZE(winfo)); GetWindowTextW(hInfo, winfo, ARRAYSIZE(winfo));
hdc = BeginPaint(hCtrl , &ps); hdc = BeginPaint(hCtrl , &ps);
SelectObject(hdc, hFont); SelectObject(hdc, hInfoFont);
SetBkColor(hdc, GetSysColor(COLOR_BTNFACE)); SetBkColor(hdc, GetSysColor(COLOR_BTNFACE));
SetTextAlign(hdc , TA_CENTER | TA_BASELINE); SetTextAlign(hdc , TA_CENTER | TA_BASELINE);
GetClientRect(hCtrl , &rect); GetClientRect(hCtrl , &rect);
// If you don't fill the client area, you get leftover text artifacts // If you don't fill the client area, you get leftover text artifacts
FillRect(hdc, &rect, CreateSolidBrush(GetSysColor(COLOR_BTNFACE))); FillRect(hdc, &rect, hInfoBrush);
TextOutW(hdc, rect.right/2, rect.bottom/2 + (int)(5.0f * fScale), winfo, (int)wcslen(winfo)); ExtTextOutW(hdc, rect.right/2, rect.bottom/2 + (int)(5.0f * fScale), ETO_CLIPPED, &rect, winfo, (int)wcslen(winfo), NULL);
EndPaint(hCtrl, &ps); EndPaint(hCtrl, &ps);
return (INT_PTR)TRUE; return (INT_PTR)TRUE;
} }
@ -1609,9 +1610,11 @@ void InitDialog(HWND hDlg)
else if (s16 >= 20) else if (s16 >= 20)
s16 = 24; s16 = 24;
// Create the font for the Info edit box // Create the font and brush for the Info edit box
hFont = CreateFontA(lfHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, hInfoFont = CreateFontA(lfHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET,
0, 0, PROOF_QUALITY, 0, (nWindowsVersion >= WINDOWS_VISTA)?"Segoe UI":"Arial Unicode MS"); 0, 0, PROOF_QUALITY, 0, (nWindowsVersion >= WINDOWS_VISTA)?"Segoe UI":"Arial Unicode MS");
SendDlgItemMessageA(hDlg, IDC_INFO, WM_SETFONT, (WPARAM)hInfoFont, TRUE);
hInfoBrush = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
// Create the title bar icon // Create the title bar icon
SetTitleBarIcon(hDlg); SetTitleBarIcon(hDlg);

View file

@ -32,7 +32,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 242, 376 IDD_DIALOG DIALOGEX 12, 12, 242, 376
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Rufus 2.2.660" CAPTION "Rufus 2.2.661"
FONT 8, "Segoe UI", 400, 0, 0x1 FONT 8, "Segoe UI", 400, 0, 0x1
BEGIN BEGIN
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8 LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
@ -65,7 +65,7 @@ BEGIN
CONTROL "Use Rufus MBR with BIOS ID",IDC_RUFUS_MBR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,272,112,10 CONTROL "Use Rufus MBR with BIOS ID",IDC_RUFUS_MBR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,272,112,10
COMBOBOX IDC_DISK_ID,128,270,100,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_DISK_ID,128,270,100,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,8,298,225,9 CONTROL "",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,8,298,225,9
EDITTEXT IDC_INFO,8,316,225,12,ES_CENTER | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE EDITTEXT IDC_INFO,8,316,225,12,ES_CENTER | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
PUSHBUTTON "About...",IDC_ABOUT,8,339,50,14 PUSHBUTTON "About...",IDC_ABOUT,8,339,50,14
PUSHBUTTON "Log",IDC_LOG,63,339,21,14 PUSHBUTTON "Log",IDC_LOG,63,339,21,14
PUSHBUTTON "T",IDC_TEST,90,339,12,14,NOT WS_VISIBLE PUSHBUTTON "T",IDC_TEST,90,339,12,14,NOT WS_VISIBLE
@ -157,7 +157,7 @@ END
IDD_DIALOG_XP DIALOGEX 12, 12, 242, 376 IDD_DIALOG_XP DIALOGEX 12, 12, 242, 376
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Rufus 2.2.660" CAPTION "Rufus 2.2.661"
FONT 8, "MS Shell Dlg", 400, 0, 0x1 FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN BEGIN
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8 LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
@ -190,7 +190,7 @@ BEGIN
CONTROL "Use Rufus MBR with BIOS ID",IDC_RUFUS_MBR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,272,112,10 CONTROL "Use Rufus MBR with BIOS ID",IDC_RUFUS_MBR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,272,112,10
COMBOBOX IDC_DISK_ID,128,270,100,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_DISK_ID,128,270,100,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,8,298,225,9 CONTROL "",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,8,298,225,9
EDITTEXT IDC_INFO,8,316,225,12,ES_CENTER | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE EDITTEXT IDC_INFO,8,316,225,12,ES_CENTER | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
PUSHBUTTON "About...",IDC_ABOUT,8,339,50,14 PUSHBUTTON "About...",IDC_ABOUT,8,339,50,14
PUSHBUTTON "Log",IDC_LOG,63,339,21,14 PUSHBUTTON "Log",IDC_LOG,63,339,21,14
PUSHBUTTON "T",IDC_TEST,90,339,12,14,NOT WS_VISIBLE PUSHBUTTON "T",IDC_TEST,90,339,12,14,NOT WS_VISIBLE
@ -283,7 +283,7 @@ END
IDD_DIALOG_RTL DIALOGEX 12, 12, 242, 376 IDD_DIALOG_RTL DIALOGEX 12, 12, 242, 376
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL
CAPTION "Rufus 2.2.660" CAPTION "Rufus 2.2.661"
FONT 8, "Segoe UI", 400, 0, 0x1 FONT 8, "Segoe UI", 400, 0, 0x1
BEGIN BEGIN
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8 LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
@ -316,7 +316,7 @@ BEGIN
CONTROL "Use Rufus MBR with BIOS ID",IDC_RUFUS_MBR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,272,112,10 CONTROL "Use Rufus MBR with BIOS ID",IDC_RUFUS_MBR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,272,112,10
COMBOBOX IDC_DISK_ID,128,270,100,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_DISK_ID,128,270,100,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,8,298,225,9 CONTROL "",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,8,298,225,9
EDITTEXT IDC_INFO,8,316,225,12,ES_CENTER | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE EDITTEXT IDC_INFO,8,316,225,12,ES_CENTER | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
PUSHBUTTON "About...",IDC_ABOUT,8,339,50,14 PUSHBUTTON "About...",IDC_ABOUT,8,339,50,14
PUSHBUTTON "Log",IDC_LOG,63,339,21,14 PUSHBUTTON "Log",IDC_LOG,63,339,21,14
PUSHBUTTON "T",IDC_TEST,90,339,12,14,NOT WS_VISIBLE PUSHBUTTON "T",IDC_TEST,90,339,12,14,NOT WS_VISIBLE
@ -415,7 +415,7 @@ END
IDD_DIALOG_RTL_XP DIALOGEX 12, 12, 242, 376 IDD_DIALOG_RTL_XP DIALOGEX 12, 12, 242, 376
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL
CAPTION "Rufus 2.2.660" CAPTION "Rufus 2.2.661"
FONT 8, "MS Shell Dlg", 400, 0, 0x1 FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN BEGIN
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8 LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
@ -448,7 +448,7 @@ BEGIN
CONTROL "Use Rufus MBR with BIOS ID",IDC_RUFUS_MBR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,272,112,10 CONTROL "Use Rufus MBR with BIOS ID",IDC_RUFUS_MBR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,272,112,10
COMBOBOX IDC_DISK_ID,128,270,100,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_DISK_ID,128,270,100,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,8,298,225,9 CONTROL "",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,8,298,225,9
EDITTEXT IDC_INFO,8,316,225,12,ES_CENTER | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE EDITTEXT IDC_INFO,8,316,225,12,ES_CENTER | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
PUSHBUTTON "About...",IDC_ABOUT,8,339,50,14 PUSHBUTTON "About...",IDC_ABOUT,8,339,50,14
PUSHBUTTON "Log",IDC_LOG,63,339,21,14 PUSHBUTTON "Log",IDC_LOG,63,339,21,14
PUSHBUTTON "T",IDC_TEST,90,339,12,14,NOT WS_VISIBLE PUSHBUTTON "T",IDC_TEST,90,339,12,14,NOT WS_VISIBLE
@ -671,8 +671,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,2,660,0 FILEVERSION 2,2,661,0
PRODUCTVERSION 2,2,660,0 PRODUCTVERSION 2,2,661,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -689,13 +689,13 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus" VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "2.2.660" VALUE "FileVersion", "2.2.661"
VALUE "InternalName", "Rufus" VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2015 Pete Batard (GPL v3)" VALUE "LegalCopyright", "© 2011-2015 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe" VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus" VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "2.2.660" VALUE "ProductVersion", "2.2.661"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"