From 7125795f6aa36ff8a8fe6720a04580a77ec10a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 16 Nov 2015 20:22:29 +0100 Subject: [PATCH] E-mail: Fixed initial window size. * It did not take the height-for-width view into account. * However, the explicitly set preferred size seems to be ignored. --- src/preferences/mail/ConfigWindow.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/preferences/mail/ConfigWindow.cpp b/src/preferences/mail/ConfigWindow.cpp index 2afb5a40e2..0e52732c3d 100644 --- a/src/preferences/mail/ConfigWindow.cpp +++ b/src/preferences/mail/ConfigWindow.cpp @@ -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)); @@ -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(); } @@ -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() @@ -406,8 +412,6 @@ ConfigWindow::_LoadSettings() fprintf(stderr, B_TRANSLATE("Error retrieving general settings: %s\n"), strerror(status)); } - - CenterOnScreen(); }