[PATCH 2/2] PackageInstaller: Appearance tweaks

  • From: John Scipione <jscipione@xxxxxxxxx>
  • Date: Tue, 18 Feb 2014 20:06:17 -0500

Right align the labels again, but better.

Add some glue to the left of the installation type menu field so that it
takes up only the space it needs to show its contents.
---
 src/apps/packageinstaller/PackageView.cpp | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/apps/packageinstaller/PackageView.cpp
b/src/apps/packageinstaller/PackageView.cpp
index 227dcbc..c5ab48d 100644
--- a/src/apps/packageinstaller/PackageView.cpp
+++ b/src/apps/packageinstaller/PackageView.cpp
@@ -499,6 +499,7 @@ PackageView::_InitView()
  fInstallTypes = new BPopUpMenu(B_TRANSLATE("none"));
  BMenuField* installType = new BMenuField("install_type",
  B_TRANSLATE("Installation type:"), fInstallTypes);
+ installType->SetAlignment(B_ALIGN_RIGHT);

  // Install type description text view
  fInstallTypeDescriptionView = new DescriptionTextView(
@@ -523,6 +524,7 @@ PackageView::_InitView()
  fDestination = new BPopUpMenu(B_TRANSLATE("none"));
  fDestField = new BMenuField("install_to", B_TRANSLATE("Install to:"),
  fDestination);
+ fDestField->SetAlignment(B_ALIGN_RIGHT);

  fBeginButton = new BButton("begin_button", B_TRANSLATE("Begin"),
  new BMessage(P_MSG_INSTALL));
@@ -540,14 +542,15 @@ PackageView::_InitView()
  // Build the layout
  BLayoutBuilder::Group<>(this, B_VERTICAL)
  .Add(descriptionScrollView)
- .AddGrid()
+ .AddGrid(B_USE_SMALL_SPACING, B_USE_DEFAULT_SPACING)
  .Add(typeLabelItem, 0, 0)
- .Add(typeMenuItem, 1, 0)
- .AddGlue(2, 0)
- .Add(installTypeScrollView, 1, 1, 2)
- .Add(destFieldLabelItem, 0, 2)
- .Add(destFieldMenuItem, 1, 2)
- .Add(fBeginButton, 2, 2)
+ .Add(typeMenuItem, 1, 0, 2)
+ .AddGlue(3, 0)
+ .Add(installTypeScrollView, 1, 2, 3)
+ .Add(destFieldLabelItem, 0, 3)
+ .Add(destFieldMenuItem, 1, 3)
+ .AddGlue(2, 3)
+ .Add(fBeginButton, 3, 3)
  .End()
  .SetInsets(B_USE_DEFAULT_SPACING)
  ;
-- 
1.8.3.4 (Apple Git-47)

Other related posts:

  • » [PATCH 2/2] PackageInstaller: Appearance tweaks - John Scipione