BAlert: move setting default button into AddButton().
This properly fixes the crash in #12271, introduced by hrev49481.
This commit is contained in:
parent
0717601a7f
commit
a84dc7543a
@ -377,6 +377,7 @@ BAlert::AddButton(const char* label, char key)
|
|||||||
fButtons.push_back(button);
|
fButtons.push_back(button);
|
||||||
fKeys.push_back(key);
|
fKeys.push_back(key);
|
||||||
|
|
||||||
|
SetDefaultButton(button);
|
||||||
fButtonLayout->AddView(button);
|
fButtonLayout->AddView(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -643,8 +644,6 @@ BAlert::_Prepare()
|
|||||||
if (CountButtons() == 0)
|
if (CountButtons() == 0)
|
||||||
debugger("BAlerts must have at least one button.");
|
debugger("BAlerts must have at least one button.");
|
||||||
|
|
||||||
SetDefaultButton(ButtonAt(CountButtons() - 1));
|
|
||||||
|
|
||||||
float fontFactor = be_plain_font->Size() / 11.0f;
|
float fontFactor = be_plain_font->Size() / 11.0f;
|
||||||
|
|
||||||
if (fIconView->Bitmap() == NULL)
|
if (fIconView->Bitmap() == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user