Use templatized version of BLayoutBuilder
...also more B_USE_WINDOW_SPACING
This commit is contained in:
parent
d0ac609964
commit
744a39273b
@ -10,7 +10,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <Catalog.h>
|
||||
#include <GridLayoutBuilder.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <Slider.h>
|
||||
#include <String.h>
|
||||
@ -94,17 +94,15 @@ SettingsWindow::SettingsWindow(ActivityWindow* target)
|
||||
B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS),
|
||||
fTarget(target)
|
||||
{
|
||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||
|
||||
fIntervalSlider = new IntervalSlider(B_TRANSLATE("Update time interval:"),
|
||||
new BMessage(kMsgUpdateTimeInterval), kNumUpdateIntervals);
|
||||
fIntervalSlider->SetInterval(target->RefreshInterval());
|
||||
|
||||
// controls pane
|
||||
AddChild(BGroupLayoutBuilder(B_VERTICAL)
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
||||
.Add(fIntervalSlider)
|
||||
.SetInsets(10, 10, 10, 10)
|
||||
);
|
||||
.SetInsets(B_USE_WINDOW_SPACING);
|
||||
|
||||
if (target->IsAlwaysOnTop())
|
||||
SetFeel(B_MODAL_ALL_WINDOW_FEEL);
|
||||
}
|
||||
|
@ -14,9 +14,8 @@
|
||||
#include <Alert.h>
|
||||
#include <Catalog.h>
|
||||
#include <Directory.h>
|
||||
#include <GroupLayout.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <GroupView.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <Locale.h>
|
||||
#include <MenuBar.h>
|
||||
#include <MenuItem.h>
|
||||
@ -72,10 +71,10 @@ EditorTabView::SetTypeEditorTab(BView *view)
|
||||
}
|
||||
|
||||
BGroupView* group = new BGroupView(B_VERTICAL);
|
||||
BGroupLayoutBuilder(group)
|
||||
.AddGlue()
|
||||
.Add(view, 0)
|
||||
.AddGlue();
|
||||
BLayoutBuilder::Group<>(group, B_VERTICAL)
|
||||
.SetInsets(B_USE_WINDOW_SPACING, 0, B_USE_WINDOW_SPACING, 0)
|
||||
.Add(view)
|
||||
.AddGlue(25.0f);
|
||||
|
||||
group->SetName(view->Name());
|
||||
|
||||
|
@ -14,9 +14,8 @@
|
||||
#include <Autolock.h>
|
||||
#include <Bitmap.h>
|
||||
#include <Catalog.h>
|
||||
#include <GroupLayout.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <IconUtils.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <Locale.h>
|
||||
#include <MenuField.h>
|
||||
#include <MenuItem.h>
|
||||
@ -852,8 +851,6 @@ ImageView::ImageView(DataEditor &editor)
|
||||
fBitmap(NULL),
|
||||
fScaleSlider(NULL)
|
||||
{
|
||||
BGroupLayout* layout = new BGroupLayout(B_HORIZONTAL);
|
||||
SetLayout(layout);
|
||||
if (editor.Type() == B_MINI_ICON_TYPE
|
||||
|| editor.Type() == B_LARGE_ICON_TYPE
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
@ -877,7 +874,7 @@ ImageView::ImageView(DataEditor &editor)
|
||||
fScaleSlider->SetHashMarks(B_HASH_MARKS_BOTH);
|
||||
fScaleSlider->SetHashMarkCount(15);
|
||||
|
||||
BGroupLayoutBuilder(layout)
|
||||
BLayoutBuilder::Group<>(this, B_HORIZONTAL)
|
||||
.SetInsets(B_USE_WINDOW_SPACING, 256, B_USE_WINDOW_SPACING,
|
||||
B_H_SCROLL_BAR_HEIGHT) // Leave space for the icon
|
||||
.AddGlue()
|
||||
@ -887,7 +884,7 @@ ImageView::ImageView(DataEditor &editor)
|
||||
.End()
|
||||
.AddGlue();
|
||||
} else {
|
||||
BGroupLayoutBuilder(layout)
|
||||
BLayoutBuilder::Group<>(this, B_HORIZONTAL)
|
||||
.SetInsets(B_USE_WINDOW_SPACING, 256, B_USE_WINDOW_SPACING,
|
||||
B_USE_WINDOW_SPACING) // Leave space for the icon
|
||||
.AddGlue()
|
||||
|
@ -187,14 +187,10 @@ BootPromptWindow::BootPromptWindow()
|
||||
_PopulateLanguages();
|
||||
_PopulateKeymaps();
|
||||
|
||||
float spacing = be_control_look->DefaultItemSpacing();
|
||||
|
||||
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
||||
|
||||
AddChild(BLayoutBuilder::Group<>(B_VERTICAL, 0)
|
||||
.AddGroup(B_HORIZONTAL, spacing)
|
||||
.AddGroup(B_VERTICAL, spacing)
|
||||
.AddGroup(B_VERTICAL, spacing)
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
|
||||
.AddGroup(B_HORIZONTAL)
|
||||
.AddGroup(B_VERTICAL)
|
||||
.AddGroup(B_VERTICAL)
|
||||
.Add(fLanguagesLabelView)
|
||||
.Add(languagesScrollView)
|
||||
.End()
|
||||
@ -203,17 +199,17 @@ BootPromptWindow::BootPromptWindow()
|
||||
.End()
|
||||
.End()
|
||||
.Add(fInfoTextView)
|
||||
.SetInsets(spacing, spacing, spacing, spacing)
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
|
||||
B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING)
|
||||
.End()
|
||||
.Add(new BSeparatorView(B_HORIZONTAL))
|
||||
.AddGroup(B_HORIZONTAL, spacing)
|
||||
.AddGroup(B_HORIZONTAL)
|
||||
.AddGlue()
|
||||
.Add(fInstallerButton)
|
||||
.Add(fDesktopButton)
|
||||
.SetInsets(spacing, spacing, spacing, spacing)
|
||||
.End()
|
||||
.View()
|
||||
);
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING,
|
||||
B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING)
|
||||
.End();
|
||||
|
||||
fLanguagesListView->MakeFocus();
|
||||
|
||||
|
@ -44,7 +44,7 @@ of their respective holders. All rights reserved.
|
||||
#include <CharacterSetRoster.h>
|
||||
#include <E-mail.h>
|
||||
#include <GridView.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <InterfaceKit.h>
|
||||
#include <Locale.h>
|
||||
#include <MailSettings.h>
|
||||
@ -263,19 +263,16 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
|
||||
fAttachAttributesMenu);
|
||||
add_menu_to_layout(menu, mailLayout, layoutRow);
|
||||
|
||||
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
||||
|
||||
AddChild(BGroupLayoutBuilder(B_VERTICAL, kSpacing)
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
||||
.Add(interfaceBox)
|
||||
.Add(mailBox)
|
||||
.Add(BGroupLayoutBuilder(B_HORIZONTAL, kSpacing)
|
||||
.AddGroup(B_HORIZONTAL, 0)
|
||||
.Add(fRevert)
|
||||
.AddGlue()
|
||||
.Add(cancelButton)
|
||||
.Add(okButton)
|
||||
)
|
||||
.SetInsets(kSpacing, kSpacing, kSpacing, kSpacing)
|
||||
);
|
||||
.End()
|
||||
.SetInsets(B_USE_WINDOW_SPACING);
|
||||
|
||||
Show();
|
||||
}
|
||||
|
@ -274,16 +274,18 @@ MediaConverterWindow::MediaConverterWindow(BRect frame)
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
|
||||
.SetInsets(0, 0, 0, 0)
|
||||
.Add(fMenuBar)
|
||||
.AddSplit(B_HORIZONTAL, padding / 2)
|
||||
.SetInsets(padding, padding, padding, padding)
|
||||
.Add(fSourcesBox, 0.4)
|
||||
.AddGroup(B_VERTICAL, padding, 0.6)
|
||||
.AddSplit(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
|
||||
B_USE_WINDOW_SPACING, 0)
|
||||
.Add(fSourcesBox)
|
||||
.AddGroup(B_VERTICAL, B_USE_ITEM_SPACING)
|
||||
.Add(fInfoBox)
|
||||
.Add(fOutputBox)
|
||||
.End()
|
||||
.End()
|
||||
.AddGrid(padding, padding)
|
||||
.SetInsets(padding, 0, padding, padding)
|
||||
.AddGrid(B_USE_ITEM_SPACING)
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING,
|
||||
B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING)
|
||||
.Add(fStatus, 0, 0)
|
||||
.Add(fFileStatus, 0, 1)
|
||||
.Add(BSpaceLayoutItem::CreateGlue(), 1, 0)
|
||||
|
@ -222,21 +222,22 @@ BackgroundsView::BackgroundsView()
|
||||
fApply->SetExplicitAlignment(BAlignment(B_ALIGN_RIGHT,
|
||||
B_ALIGN_NO_VERTICAL));
|
||||
|
||||
AddChild(BLayoutBuilder::Group<>(B_VERTICAL)
|
||||
.AddGroup(B_HORIZONTAL)
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
|
||||
.SetInsets(B_USE_WINDOW_SPACING)
|
||||
.AddGroup(B_HORIZONTAL, 0)
|
||||
.AddGroup(B_VERTICAL, 0)
|
||||
.AddStrut(floorf(rightbox->TopBorderOffset()
|
||||
- previewBox->TopBorderOffset()) - 1)
|
||||
.Add(previewBox)
|
||||
.End()
|
||||
.AddStrut(B_USE_DEFAULT_SPACING)
|
||||
.Add(rightbox)
|
||||
.End()
|
||||
.AddGroup(B_HORIZONTAL)
|
||||
.AddGroup(B_HORIZONTAL, 0)
|
||||
.Add(fRevert)
|
||||
.Add(fApply)
|
||||
.End()
|
||||
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||
.View());
|
||||
.SetInsets(0, B_USE_DEFAULT_SPACING, 0, 0)
|
||||
.End();
|
||||
|
||||
fApply->MakeDefault(true);
|
||||
}
|
||||
|
@ -2,20 +2,21 @@
|
||||
* Copyright 2008-10, Oliver Ruiz Dorantes, <oliver.ruiz.dorantes_at_gmail.com>
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#include "BluetoothWindow.h"
|
||||
|
||||
|
||||
#include "BluetoothWindow.h"
|
||||
#include "RemoteDevicesView.h"
|
||||
|
||||
#include <Button.h>
|
||||
#include <Catalog.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <Messenger.h>
|
||||
#include <SpaceLayoutItem.h>
|
||||
#include <TabView.h>
|
||||
#include <Roster.h>
|
||||
#include <TabView.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <bluetooth/LocalDevice.h>
|
||||
#include "RemoteDevicesView.h"
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
@ -91,18 +92,17 @@ BluetoothWindow::BluetoothWindow(BRect frame)
|
||||
|
||||
fRevertButton->SetEnabled(false);
|
||||
|
||||
AddChild(BGroupLayoutBuilder(B_VERTICAL, 0)
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
|
||||
.Add(fMenubar)
|
||||
.Add(BSpaceLayoutItem::CreateVerticalStrut(5))
|
||||
.AddStrut(B_USE_DEFAULT_SPACING)
|
||||
.Add(tabView)
|
||||
.Add(BSpaceLayoutItem::CreateVerticalStrut(5))
|
||||
.Add(BGroupLayoutBuilder(B_HORIZONTAL, 0)
|
||||
.AddStrut(B_USE_DEFAULT_SPACING)
|
||||
.AddGroup(B_HORIZONTAL, 0)
|
||||
.Add(fRevertButton)
|
||||
.AddGlue()
|
||||
.Add(fDefaultsButton)
|
||||
)
|
||||
.SetInsets(5, 5, 5, 5)
|
||||
);
|
||||
.End()
|
||||
.SetInsets(B_USE_WINDOW_SPACING);
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,10 +15,9 @@
|
||||
#include <Button.h>
|
||||
#include <Catalog.h>
|
||||
#include <FindDirectory.h>
|
||||
#include <GridLayout.h>
|
||||
#include <GridLayoutBuilder.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <Layout.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <Locale.h>
|
||||
#include <MenuField.h>
|
||||
#include <MenuItem.h>
|
||||
@ -207,9 +206,7 @@ AddPrinterDialog::_BuildGUI(int stage)
|
||||
BButton *cancel = new BButton(NULL, B_TRANSLATE("Cancel"),
|
||||
new BMessage(B_CANCEL));
|
||||
|
||||
SetLayout(new BGridLayout());
|
||||
|
||||
AddChild(BGridLayoutBuilder(0, 4)
|
||||
BLayoutBuilder::Grid<>(this, B_USE_ITEM_SPACING, B_USE_ITEM_SPACING)
|
||||
.Add(fName->CreateLabelLayoutItem(), 0, 0)
|
||||
.Add(fName->CreateTextViewLayoutItem(), 1, 0)
|
||||
.Add(printerMenuField->CreateLabelLayoutItem(), 0, 1)
|
||||
@ -221,8 +218,8 @@ AddPrinterDialog::_BuildGUI(int stage)
|
||||
.Add(cancel)
|
||||
.Add(fOk)
|
||||
, 0, 3, 2)
|
||||
.SetInsets(8, 8, 8, 8)
|
||||
);
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
|
||||
B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING);
|
||||
|
||||
SetDefaultButton(fOk);
|
||||
fOk->MakeDefault(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user