Bug 424644 - button for default action ("Restart Firefox") should be on the left. r=ted

This commit is contained in:
Simon Bünzli 2008-09-08 14:01:53 +02:00
parent ccf6117319
commit de5686eca0
2 changed files with 19 additions and 24 deletions

View File

@ -87,8 +87,8 @@ BEGIN
EDITTEXT IDC_EMAILTEXT,36,133,198,14,ES_AUTOHSCROLL
CONTROL "",IDC_THROBBER,"SysAnimate32",ACS_TRANSPARENT | NOT WS_VISIBLE | WS_TABSTOP,4,152,16,16
LTEXT "your crash report will be submitted when you restart",IDC_PROGRESSTEXT,24,152,210,10,SS_NOPREFIX
PUSHBUTTON "quit without sending",IDC_CLOSEBUTTON,84,166,77,14
DEFPUSHBUTTON "restart firefox",IDC_RESTARTBUTTON,166,166,68,14
DEFPUSHBUTTON "restart firefox",IDC_RESTARTBUTTON,84,166,68,14
PUSHBUTTON "quit without sending",IDC_CLOSEBUTTON,157,166,77,14
END
IDD_VIEWREPORTDIALOG DIALOGEX 0, 0, 208, 126

View File

@ -972,26 +972,21 @@ static BOOL CALLBACK CrashReporterDialogProc(HWND hwndDlg, UINT message,
HWND hwndRestart = GetDlgItem(hwndDlg, IDC_RESTARTBUTTON);
GetRelativeRect(hwndRestart, hwndDlg, &restartRect);
// Resize close button to fit text
ResizeControl(hwndClose, closeRect, Str(ST_QUIT), true, 0);
// set the close button text and shift the buttons around
// since the size may need to change
int sizeDiff = ResizeControl(hwndClose, closeRect, Str(ST_QUIT),
true, 0);
restartRect.left -= sizeDiff;
restartRect.right -= sizeDiff;
SetDlgItemText(hwndDlg, IDC_CLOSEBUTTON, Str(ST_QUIT).c_str());
if (gRestartArgs.size() > 0) {
// set the restart button text and shift the buttons around
// since the size may need to change
int sizeDiff = ResizeControl(hwndRestart, restartRect, Str(ST_RESTART),
true, 0);
closeRect.left -= sizeDiff;
closeRect.right -= sizeDiff;
// Resize restart button to fit text
ResizeControl(hwndRestart, restartRect, Str(ST_RESTART), true, 0);
SetDlgItemText(hwndDlg, IDC_RESTARTBUTTON, Str(ST_RESTART).c_str());
} else {
// No restart arguments, move the close button over to the side
// and hide the restart button
// No restart arguments, so just hide the restart button
SetDlgItemVisible(hwndDlg, IDC_RESTARTBUTTON, false);
int size = closeRect.right - closeRect.left;
closeRect.right = restartRect.right;
closeRect.left = closeRect.right - size;
}
// See if we need to widen the window
// Leave 6 pixels on either side + 6 pixels between the buttons
@ -1008,22 +1003,22 @@ static BOOL CALLBACK CrashReporterDialogProc(HWND hwndDlg, UINT message,
MoveWindow(hwndDlg, r.left, r.top,
r.right - r.left, r.bottom - r.top, TRUE);
// shift both buttons right
if (closeRect.left + maxdiff < 6)
if (restartRect.left + maxdiff < 6)
maxdiff += 6;
closeRect.left += maxdiff;
closeRect.right += maxdiff;
restartRect.left += maxdiff;
restartRect.right += maxdiff;
MoveWindow(hwndRestart, restartRect.left, restartRect.top,
restartRect.right - restartRect.left,
restartRect.bottom - restartRect.top,
MoveWindow(hwndClose, closeRect.left, closeRect.top,
closeRect.right - closeRect.left,
closeRect.bottom - closeRect.top,
TRUE);
StretchControlsToFit(hwndDlg);
}
// need to move the close button regardless
MoveWindow(hwndClose, closeRect.left, closeRect.top,
closeRect.right - closeRect.left,
closeRect.bottom - closeRect.top,
// need to move the restart button regardless
MoveWindow(hwndRestart, restartRect.left, restartRect.top,
restartRect.right - restartRect.left,
restartRect.bottom - restartRect.top,
TRUE);
// Resize the description text last, in case the window was resized