From b0cca4a89ed45fce047acbdb5075ebfecdfd8223 Mon Sep 17 00:00:00 2001 From: dsa-t Date: Wed, 15 Dec 2021 07:35:44 +0300 Subject: [PATCH] Symbol Fields Table: Make list look as good as possible on Windows too --- eeschema/dialogs/dialog_symbol_fields_table.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/eeschema/dialogs/dialog_symbol_fields_table.cpp b/eeschema/dialogs/dialog_symbol_fields_table.cpp index 72a6eb2294..38d769f9e3 100644 --- a/eeschema/dialogs/dialog_symbol_fields_table.cpp +++ b/eeschema/dialogs/dialog_symbol_fields_table.cpp @@ -1170,8 +1170,14 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnTableItemContextMenu( wxGridEvent& event ) void DIALOG_SYMBOL_FIELDS_TABLE::OnSizeFieldList( wxSizeEvent& event ) { + // GetClientSize subtracts scrollbars width on Windows. + // On other platforms, the visible area must be computed manually. +#ifdef __WINDOWS__ + int nameColWidth = m_fieldsCtrl->GetClientSize().x - m_showColWidth - m_groupByColWidth; +#else int nameColWidth = event.GetSize().GetX() - m_showColWidth - m_groupByColWidth - - wxSystemSettings::GetMetric( wxSYS_VSCROLL_X ); + - wxSystemSettings::GetMetric( wxSYS_VSCROLL_X ); +#endif // GTK loses its head and messes these up when resizing the splitter bar: m_fieldsCtrl->GetColumn( SHOW_FIELD_COLUMN )->SetWidth( m_showColWidth ); @@ -1180,6 +1186,8 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnSizeFieldList( wxSizeEvent& event ) m_fieldsCtrl->GetColumn( CANONICAL_NAME_COLUMN )->SetHidden( true ); m_fieldsCtrl->GetColumn( DISPLAY_NAME_COLUMN )->SetWidth( nameColWidth ); + m_fieldsCtrl->Refresh(); // To refresh checkboxes on Windows. + event.Skip(); }