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

[ui] fix accessibility issues for high contrast scheme

* Also make sure we use system colours everywhere, rather than our own
* Closes #535
This commit is contained in:
Pete Batard 2015-06-21 17:59:59 +01:00
parent 517a14ccb1
commit a9ee79bdad
4 changed files with 14 additions and 14 deletions

View file

@ -1572,6 +1572,7 @@ static INT_PTR CALLBACK InfoCallback(HWND hCtrl, UINT message, WPARAM wParam, LP
GetWindowTextW(hInfo, winfo, ARRAYSIZE(winfo)); GetWindowTextW(hInfo, winfo, ARRAYSIZE(winfo));
hdc = BeginPaint(hCtrl , &ps); hdc = BeginPaint(hCtrl , &ps);
SelectObject(hdc, hInfoFont); SelectObject(hdc, hInfoFont);
SetTextColor(hdc, GetSysColor(COLOR_BTNTEXT));
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);
@ -2050,6 +2051,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
SetBkMode(pDI->hDC, TRANSPARENT); SetBkMode(pDI->hDC, TRANSPARENT);
switch(pDI->itemID) { switch(pDI->itemID) {
case 0: // left part case 0: // left part
SetTextColor(pDI->hDC, GetSysColor(COLOR_BTNTEXT));
DrawTextExU(pDI->hDC, szStatusMessage, -1, &pDI->rcItem, DrawTextExU(pDI->hDC, szStatusMessage, -1, &pDI->rcItem,
DT_LEFT|DT_END_ELLIPSIS|DT_PATH_ELLIPSIS, NULL); DT_LEFT|DT_END_ELLIPSIS|DT_PATH_ELLIPSIS, NULL);
return (INT_PTR)TRUE; return (INT_PTR)TRUE;

View file

@ -68,8 +68,6 @@
#define MAX_FAT32_SIZE 2.0f // Threshold above which we disable FAT32 formatting (in TB) #define MAX_FAT32_SIZE 2.0f // Threshold above which we disable FAT32 formatting (in TB)
#define FAT32_CLUSTER_THRESHOLD 1.011f // For FAT32, cluster size changes don't occur at power of 2 boundaries but sligthly above #define FAT32_CLUSTER_THRESHOLD 1.011f // For FAT32, cluster size changes don't occur at power of 2 boundaries but sligthly above
#define DD_BUFFER_SIZE 65536 // Minimum size of the buffer we use for DD operations #define DD_BUFFER_SIZE 65536 // Minimum size of the buffer we use for DD operations
#define WHITE RGB(255,255,255)
#define SEPARATOR_GREY RGB(223,223,223)
#define RUFUS_URL "http://rufus.akeo.ie" #define RUFUS_URL "http://rufus.akeo.ie"
#define DOWNLOAD_URL RUFUS_URL "/downloads" #define DOWNLOAD_URL RUFUS_URL "/downloads"
#define FILES_URL RUFUS_URL "/files" #define FILES_URL RUFUS_URL "/files"

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.3.677" CAPTION "Rufus 2.3.678"
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
@ -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.3.677" CAPTION "Rufus 2.3.678"
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
@ -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.3.677" CAPTION "Rufus 2.3.678"
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
@ -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.3.677" CAPTION "Rufus 2.3.678"
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
@ -671,8 +671,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,3,677,0 FILEVERSION 2,3,678,0
PRODUCTVERSION 2,3,677,0 PRODUCTVERSION 2,3,678,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.3.677" VALUE "FileVersion", "2.3.678"
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.3.677" VALUE "ProductVersion", "2.3.678"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View file

@ -594,7 +594,7 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP
// Prevent resizing // Prevent resizing
static LRESULT disabled[9] = { HTLEFT, HTRIGHT, HTTOP, HTBOTTOM, HTSIZE, static LRESULT disabled[9] = { HTLEFT, HTRIGHT, HTTOP, HTBOTTOM, HTSIZE,
HTTOPLEFT, HTTOPRIGHT, HTBOTTOMLEFT, HTBOTTOMRIGHT }; HTTOPLEFT, HTTOPRIGHT, HTBOTTOMLEFT, HTBOTTOMRIGHT };
static HBRUSH white_brush, separator_brush; static HBRUSH background_brush, separator_brush;
// To use the system message font // To use the system message font
NONCLIENTMETRICS ncm; NONCLIENTMETRICS ncm;
HFONT hDlgFont; HFONT hDlgFont;
@ -622,8 +622,8 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP
SendMessage(GetDlgItem(hDlg, IDNO), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0)); SendMessage(GetDlgItem(hDlg, IDNO), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));
apply_localization(IDD_NOTIFICATION, hDlg); apply_localization(IDD_NOTIFICATION, hDlg);
white_brush = CreateSolidBrush(WHITE); background_brush = CreateSolidBrush(GetSysColor(COLOR_3DHILIGHT));
separator_brush = CreateSolidBrush(SEPARATOR_GREY); separator_brush = CreateSolidBrush(GetSysColor(COLOR_3DLIGHT));
SetTitleBarIcon(hDlg); SetTitleBarIcon(hDlg);
CenterDialog(hDlg); CenterDialog(hDlg);
// Change the default icon // Change the default icon
@ -654,7 +654,7 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP
if ((HWND)lParam == GetDlgItem(hDlg, IDC_NOTIFICATION_LINE)) { if ((HWND)lParam == GetDlgItem(hDlg, IDC_NOTIFICATION_LINE)) {
return (INT_PTR)separator_brush; return (INT_PTR)separator_brush;
} }
return (INT_PTR)white_brush; return (INT_PTR)background_brush;
case WM_NCHITTEST: case WM_NCHITTEST:
// Check coordinates to prevent resize actions // Check coordinates to prevent resize actions
loc = DefWindowProc(hDlg, message, wParam, lParam); loc = DefWindowProc(hDlg, message, wParam, lParam);