[core] display a notice about Legacy in the protective MBR for GPT

* This should help Windows users who create a GPT/UEFI drive and try to use it in BIOS/Legacy
* Also make sure that we take into account the split space for both "SELECT" and "DOWNLOAD"
This commit is contained in:
Pete Batard 2019-03-16 13:01:55 +00:00
parent 789373ed59
commit 28c1d6eb31
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
11 changed files with 200 additions and 10 deletions

View file

@ -155,8 +155,10 @@ void GetMainButtonsWidth(HWND hDlg)
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
bw = rc.right - rc.left;
for (i = 0; i < ARRAYSIZE(main_button_ids); i++)
bw = max(bw, GetTextWidth(hDlg, main_button_ids[i]) + cbw);
for (i = 0; i < ARRAYSIZE(main_button_ids); i++) {
// Make sure we add extra space for the SELECT split button (i == 0) if Fido is enabled
bw = max(bw, GetTextWidth(hDlg, main_button_ids[i]) + ((enable_fido && i == 0) ? (3 * cbw) / 2 : cbw));
}
// The 'CLOSE' button is also be used to display 'CANCEL' and we sometimes
// want to add "DOWNLOAD" into the Select split button => measure that too.
bw = max(bw, GetTextSize(GetDlgItem(hDlg, IDCANCEL), lmprintf(MSG_007)).cx + cbw);