Tweak preferences layout

This commit is contained in:
Jaidyn Ann 2021-05-30 22:04:45 -05:00
parent 70c6001189
commit ca2e05915d
4 changed files with 13 additions and 20 deletions

View File

@ -8,8 +8,7 @@
#include <Button.h>
#include <ControlLook.h>
#include <GroupLayout.h>
#include <GroupLayoutBuilder.h>
#include <LayoutBuilder.h>
#include <ListView.h>
#include <PopUpMenu.h>
#include <ScrollView.h>
@ -73,24 +72,22 @@ PreferencesAccounts::PreferencesAccounts()
ToolButton* proto = new ToolButton("Add", NULL);
proto->SetMenu(fProtosMenu);
fDelButton = new ToolButton("Del", new BMessage(kDelAccount));
fEditButton = new ToolButton("Edit...", new BMessage(kEditAccount));
fDelButton = new BButton("Del", new BMessage(kDelAccount));
fEditButton = new BButton("Edit" B_UTF8_ELLIPSIS, new BMessage(kEditAccount));
fDelButton->SetEnabled(false);
fEditButton->SetEnabled(false);
const float spacing = be_control_look->DefaultItemSpacing();
SetLayout(new BGroupLayout(B_HORIZONTAL, spacing));
AddChild(BGroupLayoutBuilder(B_VERTICAL)
BLayoutBuilder::Group<>(this, B_VERTICAL)
.SetInsets(B_USE_DEFAULT_SPACING)
.Add(scrollView)
.AddGroup(B_HORIZONTAL, spacing)
.AddGroup(B_HORIZONTAL)
.SetInsets(0, 0, 0, 15)
.Add(proto)
.Add(fDelButton)
.AddGlue()
.Add(fEditButton)
.End()
.SetInsets(spacing, spacing, spacing, spacing)
);
.End();
}

View File

@ -24,8 +24,8 @@ public:
private:
BListView* fListView;
BPopUpMenu* fProtosMenu;
ToolButton* fDelButton;
ToolButton* fEditButton;
BButton* fDelButton;
BButton* fEditButton;
void _LoadListView(ProtocolSettings* settings);

View File

@ -32,15 +32,12 @@ PreferencesDialog::PreferencesDialog()
BButton* ok = new BButton("OK", new BMessage(kApply));
const float spacing = be_control_look->DefaultItemSpacing();
BLayoutBuilder::Group<>(this, B_VERTICAL)
.Add(tabView)
.AddGroup(B_HORIZONTAL)
.AddGlue()
.Add(ok)
.SetInsets(spacing, spacing, 0, 0)
.End()
.SetInsets(spacing, spacing, spacing, spacing);
.End();
CenterOnScreen();
}
@ -57,3 +54,5 @@ PreferencesDialog::MessageReceived(BMessage* msg)
BWindow::MessageReceived(msg);
}
}

View File

@ -37,7 +37,6 @@ ToolButton::ToolButton(const char* name, const char* label,
fMenu(NULL),
fPreferredSize(-1, -1)
{
SetFontSize(be_plain_font->Size() * 0.85f);
}
@ -49,7 +48,6 @@ ToolButton::ToolButton(const char* label, BMessage* message)
fMenu(NULL),
fPreferredSize(-1, -1)
{
SetFontSize(be_plain_font->Size() * 0.85f);
}
@ -60,7 +58,6 @@ ToolButton::ToolButton(BMessage* archive)
fMenu(NULL),
fPreferredSize(-1, -1)
{
SetFontSize(be_plain_font->Size() * 0.85f);
}