Skip to content

Commit

Permalink
Cleanup server settings layout
Browse files Browse the repository at this point in the history
- Use a grid layout to properly align all the fields
- Make sure the fields have a reasonable width
  • Loading branch information
pulkomandy committed Aug 13, 2017
1 parent eb5b9ff commit 142aa13
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions src/ServerEntryWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,18 @@ ServerEntryWindow::ServerEntryWindow(BHandler* handler, BMessage* invoked,
passwordField = new BTextControl("password", NULL, password.String(), NULL,
B_WILL_DRAW | B_NAVIGABLE);

BLayoutBuilder::Group<>(this, B_VERTICAL)
BLayoutBuilder::Grid<>(this)
.SetInsets(B_USE_HALF_ITEM_INSETS)
.Add(serverName)
.Add(port)
.AddGroup(B_HORIZONTAL)
.Add(usePassword)
.Add(passwordField)
.End()
.AddGroup(B_HORIZONTAL)
.Add(securePort)
.AddGlue()
.End()
.Add(statusField)
.AddGroup(B_HORIZONTAL, B_USE_HALF_ITEM_SPACING)
.AddGlue()
.Add(serverName->CreateLabelLayoutItem(), 0, 0)
.Add(serverName->CreateTextViewLayoutItem(), 1, 0)
.Add(port->CreateLabelLayoutItem(), 0, 1)
.Add(port->CreateTextViewLayoutItem(), 1, 1)
.Add(usePassword, 0, 2)
.Add(passwordField, 1, 2)
.Add(securePort, 0, 3, 2)
.Add(statusField->CreateLabelLayoutItem(), 0, 4)
.Add(statusField->CreateMenuBarLayoutItem(), 1, 4)
.AddGroup(B_HORIZONTAL, B_USE_HALF_ITEM_SPACING, 1, 5, 1, 1)
.Add(cancelButton)
.Add(okButton)
.End()
Expand Down

0 comments on commit 142aa13

Please sign in to comment.