From 2e4bb307dc9e1c19f54968ee561b11ec20624533 Mon Sep 17 00:00:00 2001 From: Chris Pavlina Date: Fri, 15 Jan 2016 20:56:16 -0500 Subject: [PATCH] Fix dialog sizing issue on Windows --- common/dialogs/dialog_hotkeys_editor.cpp | 2 +- eeschema/dialogs/dialog_eeschema_options.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/common/dialogs/dialog_hotkeys_editor.cpp b/common/dialogs/dialog_hotkeys_editor.cpp index ac50980d91..fac42548ed 100644 --- a/common/dialogs/dialog_hotkeys_editor.cpp +++ b/common/dialogs/dialog_hotkeys_editor.cpp @@ -90,7 +90,7 @@ void HOTKEY_LIST_CTRL::OnSize( wxSizeEvent& aEvent ) #endif SetColumnWidth( 1, 100 ); - SetColumnWidth( 0, rect.width - 120 ); + SetColumnWidth( 0, rect.width - 130 ); } diff --git a/eeschema/dialogs/dialog_eeschema_options.cpp b/eeschema/dialogs/dialog_eeschema_options.cpp index 28c715e36a..01d7a07db4 100644 --- a/eeschema/dialogs/dialog_eeschema_options.cpp +++ b/eeschema/dialogs/dialog_eeschema_options.cpp @@ -69,7 +69,6 @@ DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( SCH_EDIT_FRAME* parent ) : m_hotkeyListCtrl = new HOTKEY_LIST_CTRL( m_controlsPanel, sections ); // Insert after the "Hotkeys:" label m_controlsSizer->Insert( 1, m_hotkeyListCtrl, wxSizerFlags( 1 ).Expand().Border( wxALL, 5 ) ); - Layout(); // Bind event for the import/export menu Bind( wxEVT_MENU, &DIALOG_EESCHEMA_OPTIONS::OnMenu, this ); @@ -77,6 +76,14 @@ DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( SCH_EDIT_FRAME* parent ) : // Make sure we select the first tab of the options tab page m_notebook->SetSelection( 0 ); + // Lay out all child pages + // No, I don't know why this->Layout() doesn't propagate through to these, + // but at least on MSW, it does not. + for( size_t i = 0; i < m_notebook->GetPageCount(); ++i ) + { + m_notebook->GetPage( i )->Layout(); + } + Layout(); } @@ -317,6 +324,7 @@ bool DIALOG_EESCHEMA_OPTIONS::TransferDataToWindow() m_fieldGrid->AutoSizeRows(); m_fieldGrid->Thaw(); + Layout(); return true; }