Debugger: fix empty button on alerts with only 2 buttons
When no debuginfo is available from packages, the alert has only two buttons. This was not handled correctly, leading to a small empty button being present. Change-Id: I44de1101f7cd539da5c582eaf34bb1476aa9ab20 Reviewed-on: https://review.haiku-os.org/c/haiku/+/6462 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
@@ -68,13 +68,28 @@ AlertWithCheckbox::AlertWithCheckbox(const char* title, const char* messageText,
|
|||||||
message->SetExplicitMinSize(BSize(width, B_SIZE_UNSET));
|
message->SetExplicitMinSize(BSize(width, B_SIZE_UNSET));
|
||||||
}
|
}
|
||||||
|
|
||||||
fDontAskAgain = new BCheckBox("checkbox",
|
fDontAskAgain = new BCheckBox("checkbox", checkboxLabel, NULL);
|
||||||
checkboxLabel, NULL);
|
|
||||||
|
|
||||||
BButton* button1 = new BButton(label1, label1, new BMessage(kButton1Message));
|
BGroupView* buttonGroup = new BGroupView(B_HORIZONTAL);
|
||||||
BButton* button2 = new BButton(label2, label2, new BMessage(kButton2Message));
|
BLayoutBuilder::Group<> layoutBuilder(buttonGroup);
|
||||||
BButton* button3 = new BButton(label3, label3, new BMessage(kButton3Message));
|
|
||||||
button1->MakeDefault(true);
|
layoutBuilder.AddGlue();
|
||||||
|
|
||||||
|
if (label1) {
|
||||||
|
BButton* button = new BButton(label1, label1, new BMessage(kButton1Message));
|
||||||
|
button->MakeDefault(true);
|
||||||
|
layoutBuilder.Add(button);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (label2) {
|
||||||
|
BButton* button = new BButton(label2, label2, new BMessage(kButton2Message));
|
||||||
|
layoutBuilder.Add(button);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (label3) {
|
||||||
|
BButton* button = new BButton(label3, label3, new BMessage(kButton3Message));
|
||||||
|
layoutBuilder.Add(button);
|
||||||
|
}
|
||||||
|
|
||||||
BLayoutBuilder::Group<>(this)
|
BLayoutBuilder::Group<>(this)
|
||||||
.AddGroup(B_HORIZONTAL)
|
.AddGroup(B_HORIZONTAL)
|
||||||
@@ -86,12 +101,7 @@ AlertWithCheckbox::AlertWithCheckbox(const char* title, const char* messageText,
|
|||||||
.Add(fDontAskAgain)
|
.Add(fDontAskAgain)
|
||||||
.AddGlue()
|
.AddGlue()
|
||||||
.End()
|
.End()
|
||||||
.AddGroup(B_HORIZONTAL)
|
.Add(buttonGroup)
|
||||||
.AddGlue()
|
|
||||||
.Add(button1)
|
|
||||||
.Add(button2)
|
|
||||||
.Add(button3)
|
|
||||||
.End()
|
|
||||||
.End()
|
.End()
|
||||||
.End();
|
.End();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user