mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[internal] UI redesign, part 15
* More low scaling fixes
This commit is contained in:
parent
bdb0d3fedc
commit
77ce9d543c
8 changed files with 162 additions and 49 deletions
|
@ -40,7 +40,7 @@ o Version 1.0.23 (2018.??.??)
|
|||
MSG_119/120 + MSG_121/122 are used to create the advanced options clickable toolbars
|
||||
- *REPLACED* MSG_150 -> "Type of computer you plan to use this bootable drive with. It is up to YOU to find whether your target is of BIOS or UEFI type.\n"
|
||||
"Be mindful that CSM, which can be enabled or disabled on UEFI computers, means 'BIOS emulation', and is not really UEFI."
|
||||
- *REPLACED* MSG_151 -> ""Note: 'UEFI-CSM' means that the device will only boot in BIOS emulation mode under UEFI (also known as 'Legacy Mode'), and not in native UEFI mode."
|
||||
- *REPLACED* MSG_151 -> "Note: 'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode."
|
||||
Be mindful that you probably don't want to translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.
|
||||
- *REPLACED* MSG_152 -> "Note: 'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode')."
|
||||
- *REPLACED* MSG_163 -> "Method that will be used to create partitions."
|
||||
|
|
|
@ -361,7 +361,7 @@ t MSG_122 "Hide %s"
|
|||
t MSG_150 "Type of computer you plan to use this bootable drive with. It is up to YOU to find whether your target is of BIOS or UEFI type.\n"
|
||||
"Be mindful that CSM, which can be enabled or disabled on UEFI computers, means 'BIOS emulation', and is not really UEFI."
|
||||
# Note: You shouldn't translate 'Legacy Mode' below, as this is an option that usually appears in English in the UEFI settings.
|
||||
t MSG_151 "Note: 'UEFI-CSM' means that the device will only boot in BIOS emulation mode under UEFI (also known as 'Legacy Mode'), and not in native UEFI mode."
|
||||
t MSG_151 "Note: 'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode."
|
||||
t MSG_152 "Note: 'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode')."
|
||||
t MSG_153 "Test pattern: 0x%02X"
|
||||
t MSG_154 "Test pattern: 0x%02X, 0x%02X"
|
||||
|
@ -5122,7 +5122,7 @@ t MSG_122 "Cacher les %s"
|
|||
# Tooltips
|
||||
t MSG_150 "Type d'ordinateur avec lequel vous comptez utiliser ce disque démarrable. Il est de VOTRE responsabilité de déterminer s'il s'agit d'un type BIOS ou UEFI.\n"
|
||||
"Veuillez noter que CSM, qui peut être activé ou désactivé sur les machines de type UEFI, signifie 'émulation BIOS', et n'est pas vraiment UEFI."
|
||||
t MSG_151 "Note: 'UEFI-CSM' signifie que le périphérique démarrera seulement en mode émulation BIOS sous UEFI (i.e. 'Legacy Mode'), et non pas en mode UEFI natif."
|
||||
t MSG_151 "Note: 'UEFI-CSM' signifie que le périphérique démarrera seulement en mode émulation BIOS (i.e. 'Legacy Mode') sous UEFI, et non pas en mode UEFI natif."
|
||||
t MSG_152 "Note: 'non CSM' signifie que le périphérique démarrera seulement en mode UEFI natif, et non pas en mode émulation BIOS (i.e. 'Legacy Mode')."
|
||||
t MSG_153 "Motif de test : 0x%02X"
|
||||
t MSG_154 "Motif de test : 0x%02X, 0x%02X"
|
||||
|
|
|
@ -819,6 +819,7 @@ INT_PTR CALLBACK ChecksumCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM
|
|||
dw = rect.right - rect.left - dw + 12;
|
||||
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_MD5), 0, 0, dw, 0, 1.0f);
|
||||
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_SHA1), 0, 0, dw, 0, 1.0f);
|
||||
ResizeButtonHeight(hDlg, IDOK);
|
||||
|
||||
safe_release_dc(GetDlgItem(hDlg, IDC_MD5), hDC);
|
||||
|
||||
|
|
126
src/rufus.c
126
src/rufus.c
|
@ -68,7 +68,7 @@ static int64_t last_iso_blocking_status;
|
|||
static int selection_default, row_height, advanced_device_section_height, advanced_format_section_height, image_index;
|
||||
static int device_vpos, format_vpos, status_vpos;
|
||||
static int ddh, bw, hw, fw; // DropDown Height, Main button width, half dropdown width, full dropdown width
|
||||
static int sw, mw, bsw, hbw, sbw, ssw, tw;
|
||||
static int sw, mw, bsw, hbw, sbw, ssw, tw, dbw;
|
||||
static UINT_PTR UM_LANGUAGE_MENU_MAX = UM_LANGUAGE_MENU;
|
||||
static RECT relaunch_rc = { -65536, -65536, 0, 0};
|
||||
static UINT uQFChecked = BST_CHECKED, uMBRChecked = BST_UNCHECKED;
|
||||
|
@ -102,13 +102,13 @@ char szFolderPath[MAX_PATH], app_dir[MAX_PATH], system_dir[MAX_PATH], temp_dir[M
|
|||
char *image_path = NULL, *short_image_path;
|
||||
float fScale = 1.0f;
|
||||
int default_fs, fs, bt, pt, tt;
|
||||
int cbw, ddw; // (empty) check box width, (empty) drop down width
|
||||
int cbw, ddw, ddbh = 0, bh = 0; // (empty) check box width, (empty) drop down width, button height (for and without dropdown match)
|
||||
uint32_t dur_mins, dur_secs;
|
||||
loc_cmd* selected_locale = NULL;
|
||||
WORD selected_langid = MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT);
|
||||
DWORD MainThreadId;
|
||||
HWND hDeviceList, hPartitionScheme, hTargetSystem, hFileSystem, hClusterSize, hLabel, hBootType, hNBPasses, hLog = NULL;
|
||||
HWND hLogDlg = NULL, hProgress = NULL, hDiskID;
|
||||
HWND hLogDialog = NULL, hProgress = NULL, hDiskID;
|
||||
BOOL use_own_c32[NB_OLD_C32] = {FALSE, FALSE}, mbr_selected_by_user = FALSE, display_togo_option = FALSE;
|
||||
BOOL iso_op_in_progress = FALSE, format_op_in_progress = FALSE, right_to_left_mode = FALSE, progress_in_use = FALSE, has_uefi_csm;
|
||||
BOOL enable_HDDs = FALSE, force_update = FALSE, enable_ntfs_compression = FALSE, no_confirmation_on_cancel = FALSE, lock_drive = TRUE;
|
||||
|
@ -933,7 +933,7 @@ void UpdateProgress(int op, float percent)
|
|||
}
|
||||
|
||||
// Callback for the log window
|
||||
BOOL CALLBACK LogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
BOOL CALLBACK LogCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HDC hDC;
|
||||
HFONT hf;
|
||||
|
@ -968,7 +968,6 @@ BOOL CALLBACK LogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
style = GetWindowLong(hLog, GWL_STYLE);
|
||||
style &= ~(ES_RIGHT);
|
||||
SetWindowLong(hLog, GWL_STYLE, style);
|
||||
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam)) {
|
||||
|
@ -1004,6 +1003,12 @@ BOOL CALLBACK LogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
reset_localization(IDD_LOG);
|
||||
log_displayed = FALSE;
|
||||
return TRUE;
|
||||
case UM_RESIZE_BUTTONS:
|
||||
// Resize our buttons for low scaling factors
|
||||
ResizeButtonHeight(hDlg, IDCANCEL);
|
||||
ResizeButtonHeight(hDlg, IDC_LOG_SAVE);
|
||||
ResizeButtonHeight(hDlg, IDC_LOG_CLEAR);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1121,13 +1126,13 @@ static void ResizeDialogs(int shift)
|
|||
MoveWindow(hMainDialog, rc.left, rc.top, point.x, point.y + shift, TRUE);
|
||||
|
||||
// Resize the log
|
||||
GetWindowRect(hLogDlg, &rc);
|
||||
GetWindowRect(hLogDialog, &rc);
|
||||
point.x = (rc.right - rc.left);
|
||||
point.y = (rc.bottom - rc.top);
|
||||
MoveWindow(hLogDlg, rc.left, rc.top, point.x, point.y + shift, TRUE);
|
||||
MoveCtrlY(hLogDlg, IDC_LOG_CLEAR, shift);
|
||||
MoveCtrlY(hLogDlg, IDC_LOG_SAVE, shift);
|
||||
MoveCtrlY(hLogDlg, IDCANCEL, shift);
|
||||
MoveWindow(hLogDialog, rc.left, rc.top, point.x, point.y + shift, TRUE);
|
||||
MoveCtrlY(hLogDialog, IDC_LOG_CLEAR, shift);
|
||||
MoveCtrlY(hLogDialog, IDC_LOG_SAVE, shift);
|
||||
MoveCtrlY(hLogDialog, IDCANCEL, shift);
|
||||
GetWindowRect(hLog, &rc);
|
||||
point.x = (rc.right - rc.left);
|
||||
point.y = (rc.bottom - rc.top) + shift;
|
||||
|
@ -1762,13 +1767,10 @@ static void CreateAdditionalControls(HWND hDlg)
|
|||
HIMAGELIST hToolbarImageList;
|
||||
RECT rc;
|
||||
SIZE sz;
|
||||
int i16, s16, toolbar_fudge = -6;
|
||||
int i16, s16, toolbar_dx = -4 - ((fScale > 1.49f) ? 1 : 0) - ((fScale > 1.99f) ? 1 : 0);
|
||||
TBBUTTON tbToolbarButtons[7];
|
||||
|
||||
// High DPI scaling
|
||||
i16 = GetSystemMetrics(SM_CXSMICON);
|
||||
// Adjust icon size lookup
|
||||
s16 = i16;
|
||||
s16 = i16 = GetSystemMetrics(SM_CXSMICON);
|
||||
if (s16 >= 54)
|
||||
s16 = 64;
|
||||
else if (s16 >= 40)
|
||||
|
@ -1832,7 +1834,7 @@ static void CreateAdditionalControls(HWND hDlg)
|
|||
GetWindowRect(GetDlgItem(hDlg, IDC_ADVANCED_DRIVE_PROPERTIES), &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
SendMessage(hAdvancedDeviceToolbar, TB_GETIDEALSIZE, (WPARAM)FALSE, (LPARAM)&sz);
|
||||
SetWindowPos(hAdvancedDeviceToolbar, HWND_TOP, rc.left + toolbar_fudge, rc.top, sz.cx, rc.bottom - rc.top, 0);
|
||||
SetWindowPos(hAdvancedDeviceToolbar, HWND_TOP, rc.left + toolbar_dx, rc.top, sz.cx, rc.bottom - rc.top, 0);
|
||||
|
||||
utf8_to_wchar_no_alloc(lmprintf((advanced_mode_format) ? MSG_122 : MSG_121, lmprintf(MSG_120)), wtbtext[1], ARRAYSIZE(wtbtext[1]));
|
||||
hAdvancedFormatToolbar = CreateWindowExW(0, TOOLBARCLASSNAME, NULL,
|
||||
|
@ -1852,7 +1854,7 @@ static void CreateAdditionalControls(HWND hDlg)
|
|||
GetWindowRect(GetDlgItem(hDlg, IDC_ADVANCED_FORMAT_OPTIONS), &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
SendMessage(hAdvancedFormatToolbar, TB_GETIDEALSIZE, (WPARAM)FALSE, (LPARAM)&sz);
|
||||
SetWindowPos(hAdvancedFormatToolbar, HWND_TOP, rc.left + toolbar_fudge, rc.top, sz.cx, rc.bottom - rc.top, 0);
|
||||
SetWindowPos(hAdvancedFormatToolbar, HWND_TOP, rc.left + toolbar_dx, rc.top, sz.cx, rc.bottom - rc.top, 0);
|
||||
|
||||
// Create the bottom toolbar
|
||||
hMultiToolbar = CreateWindowExW(0, TOOLBARCLASSNAME, NULL,
|
||||
|
@ -1874,7 +1876,7 @@ static void CreateAdditionalControls(HWND hDlg)
|
|||
tbToolbarButtons[1].fsStyle = BTNS_AUTOSIZE;
|
||||
tbToolbarButtons[1].fsState = TBSTATE_INDETERMINATE;
|
||||
tbToolbarButtons[1].iBitmap = I_IMAGENONE;
|
||||
tbToolbarButtons[1].iString = (INT_PTR)L" ";
|
||||
tbToolbarButtons[1].iString = (fScale < 1.5f) ? (INT_PTR)L"" : (INT_PTR)L" ";
|
||||
tbToolbarButtons[2].idCommand = IDC_ABOUT;
|
||||
tbToolbarButtons[2].fsStyle = BTNS_AUTOSIZE;
|
||||
tbToolbarButtons[2].fsState = TBSTATE_ENABLED;
|
||||
|
@ -1882,7 +1884,7 @@ static void CreateAdditionalControls(HWND hDlg)
|
|||
tbToolbarButtons[3].fsStyle = BTNS_AUTOSIZE;
|
||||
tbToolbarButtons[3].fsState = TBSTATE_INDETERMINATE;
|
||||
tbToolbarButtons[3].iBitmap = I_IMAGENONE;
|
||||
tbToolbarButtons[3].iString = (INT_PTR)L" ";
|
||||
tbToolbarButtons[3].iString = (fScale < 1.5f) ? (INT_PTR)L"" : (INT_PTR)L" ";
|
||||
tbToolbarButtons[4].idCommand = IDC_SETTINGS;
|
||||
tbToolbarButtons[4].fsStyle = BTNS_AUTOSIZE;
|
||||
tbToolbarButtons[4].fsState = TBSTATE_ENABLED;
|
||||
|
@ -1890,7 +1892,7 @@ static void CreateAdditionalControls(HWND hDlg)
|
|||
tbToolbarButtons[5].fsStyle = BTNS_AUTOSIZE;
|
||||
tbToolbarButtons[5].fsState = TBSTATE_INDETERMINATE;
|
||||
tbToolbarButtons[5].iBitmap = I_IMAGENONE;
|
||||
tbToolbarButtons[5].iString = (INT_PTR)L" ";
|
||||
tbToolbarButtons[5].iString = (fScale < 1.5f) ? (INT_PTR)L"" : (INT_PTR)L" ";
|
||||
tbToolbarButtons[6].idCommand = IDC_LOG;
|
||||
tbToolbarButtons[6].fsStyle = BTNS_AUTOSIZE;
|
||||
tbToolbarButtons[6].fsState = TBSTATE_ENABLED;
|
||||
|
@ -1951,6 +1953,7 @@ static void GetBasicControlsWidth(HWND hDlg)
|
|||
GetWindowRect(GetDlgItem(hDlg, IDC_SAVE), &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
sbw = rc.right - rc.left;
|
||||
bh = rc.bottom - rc.top;
|
||||
ssw = rc.left;
|
||||
GetWindowRect(hDeviceList, &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
|
@ -2032,6 +2035,7 @@ static void GetHalfDropwdownWidth(HWND hDlg)
|
|||
}
|
||||
|
||||
/*
|
||||
* dbw = dialog border width
|
||||
* mw = margin width
|
||||
* fw = full dropdown width
|
||||
* hd = half dropdown width
|
||||
|
@ -2053,6 +2057,12 @@ static void GetFullWidth(HWND hDlg)
|
|||
RECT rc;
|
||||
int i;
|
||||
|
||||
// Get the dialog border width
|
||||
GetWindowRect(hDlg, &rc);
|
||||
dbw = rc.right - rc.left;
|
||||
GetClientRect(hDlg, &rc);
|
||||
dbw -= rc.right - rc.left;
|
||||
|
||||
// Compute the minimum size needed for the Boot Selection dropdown
|
||||
GetWindowRect(GetDlgItem(hDlg, IDC_BOOT_SELECTION), &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
|
@ -2102,20 +2112,20 @@ static void PositionControls(HWND hDlg)
|
|||
RECT rc, rcSelectedImage;
|
||||
HWND hCtrl;
|
||||
SIZE sz;
|
||||
// TODO: dynamicize button_fudge
|
||||
int i, x, button_fudge = 2;
|
||||
|
||||
// Start by resizing the whole dialog
|
||||
GetWindowRect(hDlg, &rc);
|
||||
// Don't ask me why we need 3 times the margin width here instead of 2...
|
||||
// TODO: If that doesn't work, just pick additonal space from initial fw and reuse that
|
||||
SetWindowPos(hDlg, NULL, -1, -1, 3*mw + fw, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER);
|
||||
// Don't forget to add the dialog border width, since we resize the whole dialog
|
||||
SetWindowPos(hDlg, NULL, -1, -1, fw + 2*mw + dbw, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER);
|
||||
|
||||
// Resize the height of the label and progress bar to the height of standard dropdowns
|
||||
hCtrl = GetDlgItem(hDlg, IDC_DEVICE);
|
||||
GetWindowRect(hCtrl, &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
ddh = rc.bottom - rc.top;
|
||||
ddbh = ddh + button_fudge;
|
||||
bh = max(bh, ddbh);
|
||||
hCtrl = GetDlgItem(hDlg, IDC_LABEL);
|
||||
GetWindowRect(hCtrl, &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
|
@ -2185,7 +2195,7 @@ static void PositionControls(HWND hDlg)
|
|||
x = mw + fw - bw;
|
||||
if (i % 2 == 1)
|
||||
x -= bw + ssw;
|
||||
SetWindowPos(hCtrl, HWND_TOP, x, rc.top, bw, ddh + button_fudge, 0);
|
||||
SetWindowPos(hCtrl, HWND_TOP, x, rc.top, bw, ddbh, 0);
|
||||
}
|
||||
|
||||
// Reposition the Hash button
|
||||
|
@ -2247,7 +2257,7 @@ static void PositionControls(HWND hDlg)
|
|||
GetWindowRect(hCtrl, &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
SetWindowPos(hCtrl, NULL, rc.left, sz.cy - 1,
|
||||
rc.right - rc.left, ddh + button_fudge, SWP_NOZORDER);
|
||||
rc.right - rc.left, ddbh, SWP_NOZORDER);
|
||||
|
||||
hCtrl = GetDlgItem(hDlg, IDC_BOOT_SELECTION);
|
||||
GetWindowRect(hCtrl, &rcSelectedImage);
|
||||
|
@ -2256,7 +2266,46 @@ static void PositionControls(HWND hDlg)
|
|||
GetWindowRect(hCtrl, &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
SetWindowPos(hCtrl, NULL, rc.left, rcSelectedImage.top - 1,
|
||||
rc.right - rc.left, ddh + button_fudge, SWP_NOZORDER);
|
||||
rc.right - rc.left, ddbh, SWP_NOZORDER);
|
||||
}
|
||||
|
||||
// Thanks to Microsoft atrocious DPI handling, we must adjust for low DPI
|
||||
static void AdjustForLowDPI(HWND hDlg)
|
||||
{
|
||||
static int ddy = 4;
|
||||
int i, j;
|
||||
RECT rc;
|
||||
HWND hCtrl;
|
||||
int dy = 0;
|
||||
|
||||
if (fScale >= 1.3f)
|
||||
return;
|
||||
|
||||
for (i = 0; i < ARRAYSIZE(adjust_dpi_ids); i++) {
|
||||
dy += ddy;
|
||||
// "...and the other thing I really like about Microsoft's UI handling is how "
|
||||
//."you never have to introduce weird hardcoded constants all over the place, "
|
||||
// "just to make your UI look good...", said NO ONE ever.
|
||||
if (adjust_dpi_ids[i][0] == IDC_QUICK_FORMAT)
|
||||
dy += 1;
|
||||
for (j = 0; j < 5; j++) {
|
||||
if (adjust_dpi_ids[i][j] == 0)
|
||||
break;
|
||||
hCtrl = GetDlgItem(hDlg, adjust_dpi_ids[i][j]);
|
||||
GetWindowRect(hCtrl, &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
SetWindowPos(hCtrl, HWND_TOP, rc.left, rc.top + dy,
|
||||
rc.right - rc.left, rc.bottom - rc.top, 0);
|
||||
}
|
||||
}
|
||||
|
||||
format_vpos += 9 * ddy;
|
||||
status_vpos += 16 * ddy + 1;
|
||||
advanced_device_section_height += 3 * ddy;
|
||||
advanced_format_section_height += 3 * ddy + 1;
|
||||
|
||||
ResizeDialogs(dy + 2*ddy);
|
||||
InvalidateRect(hDlg, NULL, TRUE);
|
||||
}
|
||||
|
||||
static void SetSectionHeaders(HWND hDlg)
|
||||
|
@ -2269,8 +2318,8 @@ static void SetSectionHeaders(HWND hDlg)
|
|||
int i, control[3] = { IDS_DRIVE_PROPERTIES_TXT, IDS_FORMAT_OPTIONS_TXT, IDS_STATUS_TXT };
|
||||
|
||||
// Set the section header fonts and resize the static controls accordingly
|
||||
hf = CreateFontA(-MulDiv(14, GetDeviceCaps(GetDC(hMainDialog), LOGPIXELSY), 72), 0, 0, 0, FW_SEMIBOLD, FALSE, FALSE, FALSE, DEFAULT_CHARSET,
|
||||
0, 0, PROOF_QUALITY, 0, "Segoe UI");
|
||||
hf = CreateFontA(-MulDiv(14, GetDeviceCaps(GetDC(hMainDialog), LOGPIXELSY), 72), 0, 0, 0,
|
||||
FW_SEMIBOLD, FALSE, FALSE, FALSE, DEFAULT_CHARSET, 0, 0, PROOF_QUALITY, 0, "Segoe UI");
|
||||
|
||||
for (i = 0; i < ARRAYSIZE(control); i++) {
|
||||
SendDlgItemMessageA(hDlg, control[i], WM_SETFONT, (WPARAM)hf, TRUE);
|
||||
|
@ -2438,6 +2487,9 @@ static void InitDialog(HWND hDlg)
|
|||
CreateAdditionalControls(hDlg);
|
||||
SetSectionHeaders(hDlg);
|
||||
PositionControls(hDlg);
|
||||
AdjustForLowDPI(hDlg);
|
||||
// Because we created the log dialog before we computed our sizes, we need to send a custom message
|
||||
SendMessage(hLogDialog, UM_RESIZE_BUTTONS, 0, 0);
|
||||
// Create the status line and initialize the taskbar icon for progress overlay
|
||||
CreateStatusBar();
|
||||
|
||||
|
@ -2803,7 +2855,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
|||
StrArrayDestroy(&BlockingProcess);
|
||||
StrArrayDestroy(&ImageList);
|
||||
DestroyAllTooltips();
|
||||
DestroyWindow(hLogDlg);
|
||||
DestroyWindow(hLogDialog);
|
||||
GetWindowRect(hDlg, &relaunch_rc);
|
||||
EndDialog(hDlg, 0);
|
||||
break;
|
||||
|
@ -2814,7 +2866,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
|||
// Place the log Window to the right (or left for RTL) of our dialog on first display
|
||||
if (first_log_display) {
|
||||
GetClientRect(GetDesktopWindow(), &DesktopRect);
|
||||
GetWindowRect(hLogDlg, &DialogRect);
|
||||
GetWindowRect(hLogDialog, &DialogRect);
|
||||
nWidth = DialogRect.right - DialogRect.left;
|
||||
nHeight = DialogRect.bottom - DialogRect.top;
|
||||
GetWindowRect(hDlg, &DialogRect);
|
||||
|
@ -2827,13 +2879,13 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
|||
Point.x = min(DialogRect.right + offset, DesktopRect.right - nWidth);
|
||||
|
||||
Point.y = max(DialogRect.top, DesktopRect.top - nHeight);
|
||||
MoveWindow(hLogDlg, Point.x, Point.y, nWidth, nHeight, FALSE);
|
||||
MoveWindow(hLogDialog, Point.x, Point.y, nWidth, nHeight, FALSE);
|
||||
// The log may have been recentered to fit the screen, in which case, try to shift our main dialog left (or right for RTL)
|
||||
nWidth = DialogRect.right - DialogRect.left;
|
||||
nHeight = DialogRect.bottom - DialogRect.top;
|
||||
if (right_to_left_mode) {
|
||||
Point.x = DialogRect.left;
|
||||
GetWindowRect(hLogDlg, &DialogRect);
|
||||
GetWindowRect(hLogDialog, &DialogRect);
|
||||
Point.x = max(Point.x, DialogRect.right - DialogRect.left + offset);
|
||||
} else {
|
||||
Point.x = max((DialogRect.left<0)?DialogRect.left:0, Point.x - offset - nWidth);
|
||||
|
@ -2847,7 +2899,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
|||
SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)FALSE, 0);
|
||||
SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)hStart, TRUE);
|
||||
// Must come last for the log window to get focus
|
||||
ShowWindow(hLogDlg, log_displayed?SW_SHOW:SW_HIDE);
|
||||
ShowWindow(hLogDialog, log_displayed?SW_SHOW:SW_HIDE);
|
||||
break;
|
||||
case IDC_ADVANCED_DRIVE_PROPERTIES:
|
||||
advanced_mode_device = !advanced_mode_device;
|
||||
|
@ -3203,7 +3255,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
|||
display_togo_option = TRUE; // We display the ToGo controls by default and need to hide them
|
||||
first_log_display = TRUE;
|
||||
log_displayed = FALSE;
|
||||
hLogDlg = MyCreateDialog(hMainInstance, IDD_LOG, hDlg, (DLGPROC)LogProc);
|
||||
hLogDialog = MyCreateDialog(hMainInstance, IDD_LOG, hDlg, (DLGPROC)LogCallback);
|
||||
InitDialog(hDlg);
|
||||
GetDevices(0);
|
||||
EnableControls(TRUE);
|
||||
|
@ -3827,7 +3879,7 @@ relaunch:
|
|||
// .,ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
|
||||
// Ctrl-A => Select the log data
|
||||
if ( (IsWindowVisible(hLogDlg)) && (GetKeyState(VK_CONTROL) & 0x8000) &&
|
||||
if ( (IsWindowVisible(hLogDialog)) && (GetKeyState(VK_CONTROL) & 0x8000) &&
|
||||
(msg.message == WM_KEYDOWN) && (msg.wParam == 'A') ) {
|
||||
// Might also need ES_NOHIDESEL property if you want to select when not active
|
||||
Edit_SetSel(hLog, 0, -1);
|
||||
|
@ -4029,7 +4081,7 @@ relaunch:
|
|||
}
|
||||
|
||||
// Let the system handle dialog messages (e.g. those from the tab key)
|
||||
if (!IsDialogMessage(hDlg, &msg) && !IsDialogMessage(hLogDlg, &msg)) {
|
||||
if (!IsDialogMessage(hDlg, &msg) && !IsDialogMessage(hLogDialog, &msg)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
|
|
@ -153,6 +153,7 @@ enum user_message_type {
|
|||
UM_PROGRESS_EXIT,
|
||||
UM_NO_UPDATE,
|
||||
UM_UPDATE_CSM_TOOLTIP,
|
||||
UM_RESIZE_BUTTONS,
|
||||
// Start of the WM IDs for the language menu items
|
||||
UM_LANGUAGE_MENU = WM_APP + 0x100
|
||||
};
|
||||
|
@ -381,7 +382,7 @@ enum WindowsVersion {
|
|||
* Globals
|
||||
*/
|
||||
extern HINSTANCE hMainInstance;
|
||||
extern HWND hMainDialog, hLogDlg, hStatus, hDeviceList, hCapacity;
|
||||
extern HWND hMainDialog, hLogDialog, hStatus, hDeviceList, hCapacity;
|
||||
extern HWND hPartitionScheme, hTargetSystem, hFileSystem, hClusterSize, hLabel, hBootType, hNBPasses, hLog;
|
||||
extern HWND hInfo, hProgress, hDiskID;
|
||||
extern float fScale;
|
||||
|
@ -428,6 +429,7 @@ extern HWND MyCreateDialog(HINSTANCE hInstance, int Dialog_ID, HWND hWndParent,
|
|||
extern INT_PTR MyDialogBox(HINSTANCE hInstance, int Dialog_ID, HWND hWndParent, DLGPROC lpDialogFunc);
|
||||
extern void CenterDialog(HWND hDlg);
|
||||
extern void ResizeMoveCtrl(HWND hDlg, HWND hCtrl, int dx, int dy, int dw, int dh, float scale);
|
||||
extern void ResizeButtonHeight(HWND hDlg, int id);
|
||||
extern void CreateStatusBar(void);
|
||||
extern void CreateStaticFont(HDC hDC, HFONT* hFont, BOOL underlined);
|
||||
extern void SetTitleBarIcon(HWND hDlg);
|
||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -39,7 +39,7 @@ BEGIN
|
|||
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
||||
LTEXT "Device",IDS_DEVICE_TXT,8,21,216,8
|
||||
COMBOBOX IDC_DEVICE,8,30,196,10,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "...",IDC_SAVE,210,30,14,10,BS_ICON
|
||||
PUSHBUTTON "...",IDC_SAVE,210,30,14,12,BS_ICON
|
||||
LTEXT "Boot selection",IDS_BOOT_SELECTION_TXT,8,43,216,8
|
||||
COMBOBOX IDC_BOOT_SELECTION,8,52,148,10,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "#",IDC_HASH,162,52,10,10,BS_ICON
|
||||
|
@ -135,9 +135,9 @@ BEGIN
|
|||
LTEXT "",IDC_STATIC,0,0,263,38
|
||||
ICON OCR_UP,IDC_NOTIFICATION_ICON,6,6,20,20
|
||||
LTEXT "Message",IDC_NOTIFICATION_TEXT,35,10,219,20
|
||||
DEFPUSHBUTTON "No",IDNO,206,45,50,12
|
||||
PUSHBUTTON "More information",IDC_MORE_INFO,8,45,76,12,NOT WS_VISIBLE
|
||||
PUSHBUTTON "Yes",IDYES,149,45,50,12,NOT WS_VISIBLE
|
||||
DEFPUSHBUTTON "No",IDNO,206,44,50,14
|
||||
PUSHBUTTON "More information",IDC_MORE_INFO,8,44,76,14,NOT WS_VISIBLE
|
||||
PUSHBUTTON "Yes",IDYES,149,44,50,14,NOT WS_VISIBLE
|
||||
END
|
||||
|
||||
IDD_SELECTION DIALOGEX 0, 0, 312, 71
|
||||
|
@ -203,7 +203,6 @@ CAPTION "Update policy and settings"
|
|||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||
BEGIN
|
||||
ICON IDI_ICON,IDC_ABOUT_ICON,11,8,20,20
|
||||
DEFPUSHBUTTON "Close",IDCANCEL,221,173,50,11,WS_GROUP
|
||||
CONTROL "",IDC_POLICY,"RichEdit20W",WS_VSCROLL | WS_TABSTOP | 0x804,46,8,235,132,WS_EX_STATICEDGE
|
||||
GROUPBOX "Settings",IDS_UPDATE_SETTINGS_GRP,45,145,165,46
|
||||
LTEXT "Check for updates",IDS_UPDATE_FREQUENCY_TXT,51,158,80,10
|
||||
|
@ -212,6 +211,7 @@ BEGIN
|
|||
COMBOBOX IDC_INCLUDE_BETAS,133,173,66,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
GROUPBOX "",IDS_CHECK_NOW_GRP,210,145,71,46
|
||||
PUSHBUTTON "Check Now",IDC_CHECK_NOW,221,158,50,11
|
||||
DEFPUSHBUTTON "Close",IDCANCEL,221,173,50,11,WS_GROUP
|
||||
END
|
||||
|
||||
IDD_NEW_VERSION DIALOGEX 0, 0, 384, 268
|
||||
|
|
43
src/stdlg.c
43
src/stdlg.c
|
@ -59,7 +59,7 @@ static HWINEVENTHOOK fp_weh = NULL;
|
|||
static char *fp_title_str = "Microsoft Windows", *fp_button_str = "Format disk";
|
||||
|
||||
extern loc_cmd* selected_locale;
|
||||
extern int cbw, ddw;
|
||||
extern int cbw, ddw, ddbh, bh;
|
||||
|
||||
static int update_settings_reposition_ids[] = {
|
||||
IDC_POLICY,
|
||||
|
@ -488,6 +488,20 @@ void ResizeMoveCtrl(HWND hDlg, HWND hCtrl, int dx, int dy, int dw, int dh, float
|
|||
InvalidateRect(hCtrl, NULL, TRUE);
|
||||
}
|
||||
|
||||
void ResizeButtonHeight(HWND hDlg, int id)
|
||||
{
|
||||
HWND hCtrl;
|
||||
RECT rc;
|
||||
int dy = 0;
|
||||
|
||||
hCtrl = GetDlgItem(hDlg, id);
|
||||
GetWindowRect(hCtrl, &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
if (rc.bottom - rc.top < bh)
|
||||
dy = (bh - (rc.bottom - rc.top)) / 2;
|
||||
SetWindowPos(hCtrl, HWND_TOP, rc.left, rc.top - dy, rc.right - rc.left, bh, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* License callback
|
||||
*/
|
||||
|
@ -500,6 +514,7 @@ INT_PTR CALLBACK LicenseCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM
|
|||
hLicense = GetDlgItem(hDlg, IDC_LICENSE_TEXT);
|
||||
apply_localization(IDD_LICENSE, hDlg);
|
||||
CenterDialog(hDlg);
|
||||
ResizeButtonHeight(hDlg, IDCANCEL);
|
||||
// Suppress any inherited RTL flags
|
||||
style = GetWindowLong(hLicense, GWL_EXSTYLE);
|
||||
style &= ~(WS_EX_RTLREADING | WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR);
|
||||
|
@ -549,8 +564,12 @@ INT_PTR CALLBACK AboutCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP
|
|||
hCtrl = GetDlgItem(hDlg, IDC_ABOUT_LICENSE);
|
||||
GetWindowRect(hCtrl, &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
SetWindowPos(hCtrl, NULL, rc.left, rc.top,
|
||||
max(rc.right - rc.left, GetTextSize(hCtrl, NULL).cx + cbw), rc.bottom - rc.top, SWP_NOZORDER);
|
||||
dy = 0;
|
||||
if (rc.bottom - rc.top < bh)
|
||||
dy = (bh - (rc.bottom - rc.top)) / 2;
|
||||
SetWindowPos(hCtrl, NULL, rc.left, rc.top - dy,
|
||||
max(rc.right - rc.left, GetTextSize(hCtrl, NULL).cx + cbw), bh, SWP_NOZORDER);
|
||||
ResizeButtonHeight(hDlg, IDOK);
|
||||
static_sprintf(about_blurb, about_blurb_format, lmprintf(MSG_174|MSG_RTF),
|
||||
lmprintf(MSG_175|MSG_RTF, rufus_version[0], rufus_version[1], rufus_version[2]),
|
||||
right_to_left_mode?"Akeo \\\\ Pete Batard 2011-2018 © Copyright":"Copyright © 2011-2018 Pete Batard / Akeo",
|
||||
|
@ -656,6 +675,11 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP
|
|||
SendMessage(GetDlgItem(hDlg, IDC_MORE_INFO), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));
|
||||
SendMessage(GetDlgItem(hDlg, IDYES), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));
|
||||
SendMessage(GetDlgItem(hDlg, IDNO), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));
|
||||
if (bh != 0) {
|
||||
ResizeButtonHeight(hDlg, IDC_MORE_INFO);
|
||||
ResizeButtonHeight(hDlg, IDYES);
|
||||
ResizeButtonHeight(hDlg, IDNO);
|
||||
}
|
||||
|
||||
apply_localization(IDD_NOTIFICATION, hDlg);
|
||||
background_brush = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
|
||||
|
@ -844,6 +868,8 @@ INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam, LPARA
|
|||
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_SELECTION_LINE), 0, dh, 0, 0, 1.0f);
|
||||
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDOK), 0, dh, 0, 0, 1.0f);
|
||||
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDCANCEL), 0, dh, 0, 0, 1.0f);
|
||||
ResizeButtonHeight(hDlg, IDOK);
|
||||
ResizeButtonHeight(hDlg, IDCANCEL);
|
||||
|
||||
// Set the radio selection
|
||||
Button_SetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1), BST_CHECKED);
|
||||
|
@ -975,6 +1001,8 @@ INT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa
|
|||
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_LIST_LINE), 0, dh, 0, 0, 1.0f);
|
||||
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDOK), 0, dh, 0, 0, 1.0f);
|
||||
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDCANCEL), 0, dh, 0, 0, 1.0f);
|
||||
ResizeButtonHeight(hDlg, IDOK);
|
||||
ResizeButtonHeight(hDlg, IDCANCEL);
|
||||
return (INT_PTR)TRUE;
|
||||
case WM_CTLCOLORSTATIC:
|
||||
// Change the background colour for static text and icon
|
||||
|
@ -1288,6 +1316,14 @@ static void PositionControls(HWND hDlg)
|
|||
Reposition(hDlg, update_settings_reposition_ids[i], 0, dw);
|
||||
}
|
||||
}
|
||||
hCtrl = GetDlgItem(hDlg, IDC_CHECK_NOW);
|
||||
GetWindowRect(hCtrl, &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
SetWindowPos(hCtrl, HWND_TOP, rc.left, rc.top, rc.right - rc.left, ddbh, 0);
|
||||
hCtrl = GetDlgItem(hDlg, IDCANCEL);
|
||||
GetWindowRect(hCtrl, &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
SetWindowPos(hCtrl, HWND_TOP, rc.left, rc.top, rc.right - rc.left, ddbh, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1522,6 +1558,7 @@ INT_PTR CALLBACK NewVersionCallback(HWND hDlg, UINT message, WPARAM wParam, LPAR
|
|||
SendMessage(GetDlgItem(hDlg, IDC_PROGRESS), PBM_SETRANGE, 0, (MAX_PROGRESS<<16) & 0xFFFF0000);
|
||||
if (update.download_url == NULL)
|
||||
EnableWindow(GetDlgItem(hDlg, IDC_DOWNLOAD), FALSE);
|
||||
ResizeButtonHeight(hDlg, IDCANCEL);
|
||||
break;
|
||||
case WM_CTLCOLORSTATIC:
|
||||
if ((HWND)lParam != GetDlgItem(hDlg, IDC_WEBSITE))
|
||||
|
|
21
src/ui.h
21
src/ui.h
|
@ -160,3 +160,24 @@ static int half_width_ids[] = {
|
|||
IDC_CLUSTER_SIZE,
|
||||
IDC_NB_PASSES,
|
||||
};
|
||||
|
||||
static int adjust_dpi_ids[][5] = {
|
||||
{IDS_DEVICE_TXT, IDC_DEVICE, IDC_SAVE, 0, 0},
|
||||
{IDS_BOOT_SELECTION_TXT, IDC_BOOT_SELECTION, IDC_HASH, IDC_SELECT, 0},
|
||||
{IDS_IMAGE_OPTION_TXT, IDC_IMAGE_OPTION, 0, 0, 0},
|
||||
{IDS_PARTITION_TYPE_TXT, IDC_PARTITION_TYPE, IDS_TARGET_SYSTEM_TXT, IDC_TARGET_SYSTEM, IDS_CSM_HELP_TXT},
|
||||
{IDC_ADVANCED_DEVICE_TOOLBAR, 0, 0, 0, 0},
|
||||
{IDC_LIST_USB_HDD, 0, 0, 0, 0 },
|
||||
{IDC_OLD_BIOS_FIXES, 0, 0, 0, 0},
|
||||
{IDC_RUFUS_MBR, IDC_DISK_ID, 0, 0, 0},
|
||||
{IDS_FORMAT_OPTIONS_TXT, 0, 0, 0, 0},
|
||||
{IDS_LABEL_TXT, IDC_LABEL, 0, 0, 0},
|
||||
{IDS_FILE_SYSTEM_TXT, IDC_FILE_SYSTEM, IDS_CLUSTER_SIZE_TXT, IDC_CLUSTER_SIZE, 0},
|
||||
{IDC_ADVANCED_FORMAT_TOOLBAR, 0, 0, 0, 0},
|
||||
{IDC_QUICK_FORMAT, 0, 0, 0, 0},
|
||||
{IDC_EXTENDED_LABEL, 0, 0, 0, 0},
|
||||
{IDC_BAD_BLOCKS, IDC_NB_PASSES, 0, 0, 0},
|
||||
{IDS_STATUS_TXT, 0, 0, 0, 0},
|
||||
{IDC_PROGRESS, 0, 0, 0, 0 },
|
||||
{IDC_MULTI_TOOLBAR, IDC_TEST, IDC_START, IDCANCEL, 0}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue