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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user