Preferences: Consistent buttons position and spacing.

* Fix DataTranslations.
* Fix Touchpad.
* Fixes #5230.
This commit is contained in:
Janus
2015-04-21 21:15:20 +00:00
parent 510eb73653
commit 853598431c
2 changed files with 13 additions and 18 deletions
@@ -228,11 +228,10 @@ DataTranslationsWindow::_SetupViews()
_PopulateListView();
// Build the layout
float padding = be_control_look->DefaultItemSpacing();
BLayoutBuilder::Group<>(this, B_HORIZONTAL, padding)
.SetInsets(padding, padding, padding, padding)
BLayoutBuilder::Group<>(this, B_HORIZONTAL)
.SetInsets(B_USE_DEFAULT_SPACING)
.Add(scrollView, 3)
.AddGrid(padding, padding, 6)
.AddGrid(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING, 6)
.SetInsets(0, 0, 0, 0)
.Add(fRightBox, 0, 0, 3, 1)
.Add(fIconView, 0, 1)
+10 -14
View File
@@ -451,27 +451,23 @@ TouchpadPrefView::SetupView()
tapPrefLayout->AddView(fTapSlider);
BGroupView* buttonView = new BGroupView(B_HORIZONTAL, B_USE_SMALL_SPACING);
fDefaultButton = new BButton(B_TRANSLATE("Defaults"),
new BMessage(DEFAULT_SETTINGS));
buttonView->AddChild(fDefaultButton);
fRevertButton = new BButton(B_TRANSLATE("Revert"),
new BMessage(REVERT_SETTINGS));
fRevertButton->SetEnabled(false);
buttonView->AddChild(fRevertButton);
buttonView->GetLayout()->AddItem(BSpaceLayoutItem::CreateGlue());
BGroupLayout* layout = new BGroupLayout(B_VERTICAL);
layout->SetInsets(spacing, spacing, spacing, spacing);
layout->SetSpacing(spacing);
BView* rootView = new BView("root view", 0, layout);
AddChild(rootView);
rootView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
layout->AddView(scrollBox);
layout->AddView(tapBox);
layout->AddView(buttonView);
BLayoutBuilder::Group<>(this, B_VERTICAL)
.SetInsets(B_USE_DEFAULT_SPACING)
.Add(scrollBox)
.Add(tapBox)
.AddGroup(B_HORIZONTAL)
.Add(fDefaultButton)
.Add(fRevertButton)
.AddGlue()
.End()
.End();
}