Layout API changes. Tested on Haiku r39074, I really don't know what is the first revision with this changes.

This commit is contained in:
plfiorini 2010-10-24 06:27:09 +00:00
parent f8304f0c27
commit c0a63c8f26
5 changed files with 9 additions and 15 deletions

View File

@ -9,8 +9,7 @@
#include <Alert.h> #include <Alert.h>
#include <Button.h> #include <Button.h>
#include <ControlLook.h> #include <ControlLook.h>
#include <GroupLayout.h> #include <LayoutBuilder.h>
#include <GroupLayoutBuilder.h>
#include <TextControl.h> #include <TextControl.h>
#include <String.h> #include <String.h>
@ -51,9 +50,7 @@ AccountDialog::AccountDialog(const char* title, ProtocolSettings* settings,
BButton* ok = new BButton("OK", new BMessage(kOK)); BButton* ok = new BButton("OK", new BMessage(kOK));
const float spacing = be_control_look->DefaultItemSpacing(); const float spacing = be_control_look->DefaultItemSpacing();
BLayoutBuilder::Group<>(this, B_VERTICAL)
SetLayout(new BGroupLayout(B_VERTICAL, spacing));
AddChild(BGroupLayoutBuilder(B_VERTICAL, spacing)
.Add(fAccountName) .Add(fAccountName)
.Add(divider) .Add(divider)
.Add(fTop) .Add(fTop)
@ -63,8 +60,7 @@ AccountDialog::AccountDialog(const char* title, ProtocolSettings* settings,
.Add(ok) .Add(ok)
.End() .End()
.AddGlue() .AddGlue()
.SetInsets(spacing, spacing, spacing, 0) .SetInsets(spacing, spacing, spacing, 0);
);
fAccountName->MakeFocus(true); fAccountName->MakeFocus(true);

View File

@ -70,6 +70,7 @@ PreferencesBehavior::PreferencesBehavior()
.Add(fIgnoreEmoticons) .Add(fIgnoreEmoticons)
.AddGlue() .AddGlue()
.SetInsets(spacing, spacing, spacing, spacing) .SetInsets(spacing, spacing, spacing, spacing)
.TopView()
); );
} }

View File

@ -8,8 +8,7 @@
#include <Button.h> #include <Button.h>
#include <ControlLook.h> #include <ControlLook.h>
#include <GroupLayout.h> #include <LayoutBuilder.h>
#include <GroupLayoutBuilder.h>
#include <TabView.h> #include <TabView.h>
#include "PreferencesDialog.h" #include "PreferencesDialog.h"
@ -30,18 +29,14 @@ PreferencesDialog::PreferencesDialog()
BButton* ok = new BButton("OK", new BMessage(kApply)); BButton* ok = new BButton("OK", new BMessage(kApply));
const float spacing = be_control_look->DefaultItemSpacing(); const float spacing = be_control_look->DefaultItemSpacing();
BLayoutBuilder::Group<>(this, B_VERTICAL)
SetLayout(new BGroupLayout(B_VERTICAL,
be_control_look->DefaultItemSpacing()));
AddChild(BGroupLayoutBuilder(B_VERTICAL)
.Add(tabView) .Add(tabView)
.AddGroup(B_HORIZONTAL) .AddGroup(B_HORIZONTAL)
.AddGlue() .AddGlue()
.Add(ok) .Add(ok)
.SetInsets(spacing, spacing, 0, 0) .SetInsets(spacing, spacing, 0, 0)
.End() .End()
.SetInsets(spacing, spacing, spacing, spacing) .SetInsets(spacing, spacing, spacing, spacing);
);
CenterOnScreen(); CenterOnScreen();
} }

View File

@ -49,6 +49,7 @@ ContactPopUp::ContactPopUp(ContactLinker* contact)
.End() .End()
.Add(fAvatarView) .Add(fAvatarView)
.SetInsets(10, 10, 10, 10) .SetInsets(10, 10, 10, 10)
.TopView()
); );
} }

View File

@ -76,6 +76,7 @@ StatusView::StatusView(const char* name)
.AddGlue() .AddGlue()
.End() .End()
.Add(fAvatar) .Add(fAvatar)
.TopView()
); );
} }