From 967a06e0559e26da85a4c70b32bfe40aa7c5faa7 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Thu, 18 Dec 2014 13:30:44 +0100 Subject: [PATCH] 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. --- src/apps/webpositive/DownloadProgressView.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/apps/webpositive/DownloadProgressView.cpp b/src/apps/webpositive/DownloadProgressView.cpp index abb29323b8..eafb6170ee 100644 --- a/src/apps/webpositive/DownloadProgressView.cpp +++ b/src/apps/webpositive/DownloadProgressView.cpp @@ -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);