diff --git a/clientgui/DlgAdvPreferences.cpp b/clientgui/DlgAdvPreferences.cpp index 34a80c5afd..715d7a38a7 100644 --- a/clientgui/DlgAdvPreferences.cpp +++ b/clientgui/DlgAdvPreferences.cpp @@ -100,6 +100,29 @@ CDlgAdvPreferences::CDlgAdvPreferences(wxWindow* parent) : CDlgAdvPreferencesBas ReadPreferenceSettings(); // RestoreState(); + +#ifdef __WXMSW__ + int margin = 0, tabwidth = 0; + RECT r; + BOOL success = TabCtrl_GetItemRect(m_Notebook->GetHWND(), 0, &r); + if (success) { + margin = r.left; + } + + success = TabCtrl_GetItemRect(m_Notebook->GetHWND(), m_Notebook->GetPageCount()-1, &r); + if (success) { + tabwidth += r.right; + } + tabwidth += margin; + wxSize sz = m_Notebook->GetBestSize(); + if (sz.x < tabwidth) { + sz.x = tabwidth; + m_Notebook->SetMinSize(sz); + } +#endif + + this->Layout(); + Fit(); } /* destructor */ diff --git a/clientgui/DlgAdvPreferencesBase.cpp b/clientgui/DlgAdvPreferencesBase.cpp index 78633a5952..e8deae19c3 100644 --- a/clientgui/DlgAdvPreferencesBase.cpp +++ b/clientgui/DlgAdvPreferencesBase.cpp @@ -98,6 +98,7 @@ CDlgAdvPreferencesBase::CDlgAdvPreferencesBase( wxWindow* parent, int id, wxStri m_panelControls->SetSizer( notebookSizer ); m_panelControls->Layout(); notebookSizer->Fit( m_panelControls ); + dialogSizer->Add( m_panelControls, 1, wxALL|wxEXPAND, 1 ); m_panelButtons = new wxPanel( this, ID_DEFAULT, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); @@ -126,8 +127,6 @@ CDlgAdvPreferencesBase::CDlgAdvPreferencesBase( wxWindow* parent, int id, wxStri dialogSizer->Fit( this ); this->SetSizer( dialogSizer ); - this->Layout(); - Fit(); } wxPanel* CDlgAdvPreferencesBase::createProcessorTab(wxNotebook* notebook)