From 528a67b27c5626c8a47d1940d12e30e92f1b89b8 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 25 Apr 2018 11:24:39 +0200 Subject: [PATCH] Fix incorrect sizing of 2 columns in dialog, on GTK (issue perhaps depending on GTK/wxWidget version) --- eeschema/dialogs/dialog_fields_editor_global.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/eeschema/dialogs/dialog_fields_editor_global.cpp b/eeschema/dialogs/dialog_fields_editor_global.cpp index bd51ea8826..c08e2dcebc 100644 --- a/eeschema/dialogs/dialog_fields_editor_global.cpp +++ b/eeschema/dialogs/dialog_fields_editor_global.cpp @@ -385,14 +385,17 @@ DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL( SCH_EDIT_FRAME* parent #ifdef __WXGTK__ // GTK auto-sizing doesn't appear to take into account the column headers, which is // where all the width is in this case. - m_fieldsCtrl->GetColumn( 1 )->SetWidth( 50 ); - m_fieldsCtrl->GetColumn( 2 )->SetWidth( 70 ); + // So calculate the title size and set the column width + m_showColWidth = GetTextSize( m_fieldsCtrl->GetColumn( 1 )->GetTitle(), m_fieldsCtrl ).x + 15; + m_groupByColWidth = GetTextSize( m_fieldsCtrl->GetColumn( 2 )->GetTitle(), m_fieldsCtrl ).x + 15; + m_fieldsCtrl->GetColumn( 1 )->SetWidth( m_showColWidth ); + m_fieldsCtrl->GetColumn( 2 )->SetWidth( m_groupByColWidth ); #else m_fieldsCtrl->GetColumn( 1 )->SetWidth( wxCOL_WIDTH_AUTOSIZE ); m_fieldsCtrl->GetColumn( 2 )->SetWidth( wxCOL_WIDTH_AUTOSIZE ); -#endif m_showColWidth = m_fieldsCtrl->GetColumn( 1 )->GetWidth(); m_groupByColWidth = m_fieldsCtrl->GetColumn( 2 )->GetWidth(); +#endif // The fact that we're a list should keep the control from reserving space for the // expander buttons... but it doesn't. Fix by forcing the indent to 0.