Skip to content

Commit

Permalink
E-mail: Fixed initial window size.
Browse files Browse the repository at this point in the history
* It did not take the height-for-width view into account.
* However, the explicitly set preferred size seems to be ignored.
  • Loading branch information
axeld committed Nov 16, 2015
1 parent 670cfb1 commit 7125795
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/preferences/mail/ConfigWindow.cpp
Expand Up @@ -218,6 +218,8 @@ ConfigWindow::ConfigWindow()
tabView->TabAt(0)->SetLabel(B_TRANSLATE("Accounts"));

fAccountsListView = new AccountsListView(this);
fAccountsListView->SetExplicitPreferredSize(BSize(
fAccountsListView->StringWidth("W") * 22, B_SIZE_UNSET));

BButton* addButton = new BButton(NULL, B_TRANSLATE("Add"),
new BMessage(kMsgAddAccount));
Expand Down Expand Up @@ -330,10 +332,12 @@ ConfigWindow::ConfigWindow()
B_USE_WINDOW_SPACING, 0);

_LoadSettings();
// this will also move our window to the stored position

fAccountsListView->SetSelectionMessage(new BMessage(kMsgAccountSelected));
fAccountsListView->MakeFocus(true);

ResizeToPreferred();
CenterOnScreen();
}


Expand Down Expand Up @@ -374,6 +378,8 @@ ConfigWindow::_BuildHowToView()
"Select an item in the list to change its settings."));
text->MakeEditable(false);
text->MakeSelectable(false);
float fontFactor = be_plain_font->Size() / 12.0f;
text->SetExplicitPreferredSize(BSize(300 * fontFactor,400 * fontFactor));

BLayoutBuilder::Group<>(groupView, B_VERTICAL)
.AddGlue()
Expand Down Expand Up @@ -406,8 +412,6 @@ ConfigWindow::_LoadSettings()
fprintf(stderr, B_TRANSLATE("Error retrieving general settings: %s\n"),
strerror(status));
}

CenterOnScreen();
}


Expand Down

0 comments on commit 7125795

Please sign in to comment.