mirror of https://github.com/BOINC/boinc.git
MGR: On MS Windows, adjust width of Advanced Preferences dialog to fit all tabs without scrolling.
This commit is contained in:
parent
917bf6762c
commit
7a0afdba65
|
@ -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 */
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue