Right align Add and Remove buttons
This commit is contained in:
@@ -1956,25 +1956,27 @@ void
|
|||||||
FindPanel::SetUpAddRemoveButtons(BBox* box)
|
FindPanel::SetUpAddRemoveButtons(BBox* box)
|
||||||
{
|
{
|
||||||
BButton* removeButton = dynamic_cast<BButton*>(box->FindView("remove"));
|
BButton* removeButton = dynamic_cast<BButton*>(box->FindView("remove"));
|
||||||
if (removeButton == NULL) {
|
if (removeButton != NULL) {
|
||||||
BButton* addButton = new BButton("add", B_TRANSLATE("Add"),
|
removeButton->SetEnabled(fAttrGrid->CountRows() > 1);
|
||||||
new BMessage(kAddItem));
|
return;
|
||||||
addButton->SetTarget(this);
|
|
||||||
|
|
||||||
removeButton = new BButton("remove", B_TRANSLATE("Remove"),
|
|
||||||
new BMessage(kRemoveItem));
|
|
||||||
removeButton->SetEnabled(false);
|
|
||||||
removeButton->SetTarget(this);
|
|
||||||
|
|
||||||
BGroupLayout* layout = dynamic_cast<BGroupLayout*>(box->GetLayout());
|
|
||||||
BLayoutBuilder::Group<>(layout)
|
|
||||||
.AddGroup(B_HORIZONTAL)
|
|
||||||
.Add(addButton)
|
|
||||||
.Add(removeButton)
|
|
||||||
.AddGlue();
|
|
||||||
}
|
}
|
||||||
// enable remove button as needed
|
|
||||||
removeButton->SetEnabled(fAttrGrid->CountRows() > 1);
|
removeButton = new BButton("remove", B_TRANSLATE("Remove"),
|
||||||
|
new BMessage(kRemoveItem));
|
||||||
|
removeButton->SetEnabled(false);
|
||||||
|
removeButton->SetTarget(this);
|
||||||
|
|
||||||
|
BButton* addButton = new BButton("add", B_TRANSLATE("Add"),
|
||||||
|
new BMessage(kAddItem));
|
||||||
|
addButton->SetTarget(this);
|
||||||
|
|
||||||
|
BGroupLayout* layout = dynamic_cast<BGroupLayout*>(box->GetLayout());
|
||||||
|
BLayoutBuilder::Group<>(layout)
|
||||||
|
.AddGroup(B_HORIZONTAL)
|
||||||
|
.AddGlue()
|
||||||
|
.Add(removeButton)
|
||||||
|
.Add(addButton)
|
||||||
|
.End();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user