Skip to content

Commit

Permalink
BootManager: improved layouting
Browse files Browse the repository at this point in the history
Addresses #15418 without completely solving it.
At least for font sizes >= 11 points it works mostly. Buttons are
no longer cut off, though the summary page showing all partitions
is taller than necessary for > 3 partitions, esp. for smaller font
sizes.

Views aren't vertically centered at least.

Change-Id: Id6224b83f27510c9ed45e303f0b5dabf47af0574
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7062
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
  • Loading branch information
humdingerb authored and pulkomandy committed Oct 26, 2023
1 parent 3c34629 commit 6de9c42
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/apps/bootmanager/BootManagerWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@ BootManagerWindow::BootManagerWindow()
GetSizeLimits(&minWidth, &maxWidth, &minHeight, &maxHeight);

minWidth = be_control_look->DefaultLabelSpacing() * 67.0f;
minHeight = be_control_look->DefaultLabelSpacing() * 42.0f;
minHeight = be_control_look->DefaultLabelSpacing() * 52.0f;
SetSizeLimits(minWidth, maxWidth, minHeight, maxHeight);

fWizardView = new WizardView("wizard");
BLayoutBuilder::Group<>(this)
.Add(fWizardView);

fController.Initialize(fWizardView);

CenterOnScreen();

// Prevent minimizing this window if the user would have no way to
Expand Down
3 changes: 2 additions & 1 deletion src/apps/bootmanager/DescriptionPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ DescriptionPage::_BuildUI(const char* description, bool hasHeading)
SetLayout(new BGroupLayout(B_VERTICAL));

BLayoutBuilder::Group<>((BGroupLayout*)GetLayout())
.Add(fDescription);
.Add(fDescription)
.AddGlue();
}
4 changes: 2 additions & 2 deletions src/apps/bootmanager/DrivesPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ DrivesPage::DrivesPage(WizardView* wizardView, const BootMenuList& menus,
SetLayout(new BGroupLayout(B_VERTICAL));

BLayoutBuilder::Group<>((BGroupLayout*)GetLayout())
.Add(description, 0.5)
.Add(scrollView, 1);
.Add(description)
.Add(scrollView, 10.0);

_UpdateWizardButtons(NULL);
_FillDrivesView(menus);
Expand Down
2 changes: 1 addition & 1 deletion src/apps/bootmanager/PartitionsPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ PartitionsPage::_BuildUI()

BLayoutBuilder::Group<>((BGroupLayout*)GetLayout())
.Add(fDescription)
.Add(scrollView);
.Add(scrollView, 10.0);
}


Expand Down
1 change: 1 addition & 0 deletions src/apps/bootmanager/WizardView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ WizardView::SetPage(WizardPageView* page)
return;

fPageContainer->AddChild(page);
Window()->ResizeToPreferred();
}


Expand Down

0 comments on commit 6de9c42

Please sign in to comment.