Web+: force download buttons to have the same width

If the text in the button is longer than what the minimal size of
BButton allows, the button exapnd. But we want the two buttons to have
the same width and stay aligned.

Fixes part of #11471.

Note: I don't understand why I need to set the explicit max size of the
button to make it bigger (I would have expected setting the minimal size
to do that), but it works.
This commit is contained in:
Adrien Destugues
2014-12-18 14:29:54 +01:00
parent a0952d1cb3
commit 967a06e055
@@ -257,6 +257,13 @@ DownloadProgressView::Init(BMessage* archive)
}
fInfoView = new BStringView("info view", "");
BSize topButtonSize = fTopButton->PreferredSize();
BSize bottomButtonSize = fBottomButton->PreferredSize();
if (bottomButtonSize.width < topButtonSize.width)
fBottomButton->SetExplicitMaxSize(topButtonSize);
else
fTopButton->SetExplicitMaxSize(bottomButtonSize);
BGroupLayout* layout = GroupLayout();
layout->SetInsets(8, 5, 5, 6);