diff --git a/common/dialogs/dialog_configure_paths.cpp b/common/dialogs/dialog_configure_paths.cpp index 464646133a..1380f7293c 100644 --- a/common/dialogs/dialog_configure_paths.cpp +++ b/common/dialogs/dialog_configure_paths.cpp @@ -343,9 +343,9 @@ void DIALOG_CONFIGURE_PATHS::OnUpdateUI( wxUpdateUIEvent& event ) int width = m_EnvVars->GetClientRect().GetWidth(); m_EnvVars->AutoSizeColumn( TV_NAME_COL ); - m_EnvVars->SetColSize( TV_NAME_COL, std::max( m_EnvVars->GetColSize( TV_NAME_COL ), 120 ) ); + m_EnvVars->SetColSize( TV_NAME_COL, std::max( 72, m_EnvVars->GetColSize( TV_NAME_COL ) ) ); - m_EnvVars->SetColSize( TV_VALUE_COL, width - m_EnvVars->GetColSize( TV_NAME_COL ) ); + m_EnvVars->SetColSize( TV_VALUE_COL, std::max( 120, width - m_EnvVars->GetColSize( TV_NAME_COL ) ) ); m_gridWidth = m_EnvVars->GetSize().GetX(); m_gridWidthsDirty = false; diff --git a/common/dialogs/panel_text_variables.cpp b/common/dialogs/panel_text_variables.cpp index 6926968811..3ef443cdbc 100644 --- a/common/dialogs/panel_text_variables.cpp +++ b/common/dialogs/panel_text_variables.cpp @@ -200,10 +200,9 @@ void PANEL_TEXT_VARIABLES::OnUpdateUI( wxUpdateUIEvent& event ) int width = m_TextVars->GetClientRect().GetWidth(); m_TextVars->AutoSizeColumn( TV_NAME_COL ); - m_TextVars->SetColSize( TV_NAME_COL, std::max( m_TextVars->GetColSize( TV_NAME_COL ), - 120 ) ); + m_TextVars->SetColSize( TV_NAME_COL, std::max( 72, m_TextVars->GetColSize( TV_NAME_COL ) ) ); - m_TextVars->SetColSize( TV_VALUE_COL, width - m_TextVars->GetColSize( TV_NAME_COL ) ); + m_TextVars->SetColSize( TV_VALUE_COL, std::max( 120, width - m_TextVars->GetColSize( TV_NAME_COL ) ) ); m_gridWidthsDirty = false; } diff --git a/eeschema/dialogs/dialog_label_properties.cpp b/eeschema/dialogs/dialog_label_properties.cpp index e2fa523c6a..bc34ff7456 100644 --- a/eeschema/dialogs/dialog_label_properties.cpp +++ b/eeschema/dialogs/dialog_label_properties.cpp @@ -717,14 +717,14 @@ void DIALOG_LABEL_PROPERTIES::AdjustGridColumns( int aWidth ) aWidth -= ( m_grid->GetSize().x - m_grid->GetClientSize().x ); m_grid->AutoSizeColumn( 0 ); - m_grid->SetColSize( 0, std::max( m_grid->GetColSize( 0 ), 72 ) ); + m_grid->SetColSize( 0, std::max( 72, m_grid->GetColSize( 0 ) ) ); int fixedColsWidth = m_grid->GetColSize( 0 ); for( int i = 2; i < m_grid->GetNumberCols(); i++ ) fixedColsWidth += m_grid->GetColSize( i ); - m_grid->SetColSize( 1, std::max( aWidth - fixedColsWidth, 120 ) ); + m_grid->SetColSize( 1, std::max( 120, aWidth - fixedColsWidth ) ); } diff --git a/eeschema/dialogs/dialog_lib_symbol_properties.cpp b/eeschema/dialogs/dialog_lib_symbol_properties.cpp index bf4858fb6b..90b3347b0d 100644 --- a/eeschema/dialogs/dialog_lib_symbol_properties.cpp +++ b/eeschema/dialogs/dialog_lib_symbol_properties.cpp @@ -716,13 +716,14 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::adjustGridColumns() int width = KIPLATFORM::UI::GetUnobscuredSize( m_grid ).x; m_grid->AutoSizeColumn( FDC_NAME ); + m_grid->SetColSize( FDC_NAME, std::max( 72, m_grid->GetColSize( FDC_NAME ) ) ); int fixedColsWidth = m_grid->GetColSize( FDC_NAME ); for( int i = 2; i < m_grid->GetNumberCols(); i++ ) fixedColsWidth += m_grid->GetColSize( i ); - m_grid->SetColSize( FDC_VALUE, width - fixedColsWidth ); + m_grid->SetColSize( FDC_VALUE, std::max( 120, width - fixedColsWidth ) ); } diff --git a/eeschema/dialogs/dialog_sheet_properties.cpp b/eeschema/dialogs/dialog_sheet_properties.cpp index 0b281aeaec..50a37653ca 100644 --- a/eeschema/dialogs/dialog_sheet_properties.cpp +++ b/eeschema/dialogs/dialog_sheet_properties.cpp @@ -821,16 +821,14 @@ void DIALOG_SHEET_PROPERTIES::AdjustGridColumns() int width = KIPLATFORM::UI::GetUnobscuredSize( m_grid ).x; m_grid->AutoSizeColumn( 0 ); + m_grid->SetColSize( 0, std::max( 72, m_grid->GetColSize( 0 ) ) ); int fixedColsWidth = m_grid->GetColSize( 0 ); for( int i = 2; i < m_grid->GetNumberCols(); i++ ) fixedColsWidth += m_grid->GetColSize( i ); - int colSize = std::max( width - fixedColsWidth, -1 ); - colSize = ( colSize == 0 ) ? -1 : colSize; // don't hide the column! - - m_grid->SetColSize( 1, colSize ); + m_grid->SetColSize( 1, std::max( 120, width - fixedColsWidth ) ); } diff --git a/eeschema/dialogs/dialog_symbol_properties.cpp b/eeschema/dialogs/dialog_symbol_properties.cpp index 3305eede75..8d943c3e10 100644 --- a/eeschema/dialogs/dialog_symbol_properties.cpp +++ b/eeschema/dialogs/dialog_symbol_properties.cpp @@ -1064,16 +1064,14 @@ void DIALOG_SYMBOL_PROPERTIES::AdjustFieldsGridColumns() int fieldsWidth = KIPLATFORM::UI::GetUnobscuredSize( m_fieldsGrid ).x; m_fieldsGrid->AutoSizeColumn( 0 ); + m_fieldsGrid->SetColSize( 0, std::max( 72, m_fieldsGrid->GetColSize( 0 ) ) ); int fixedColsWidth = m_fieldsGrid->GetColSize( 0 ); for( int i = 2; i < m_fieldsGrid->GetNumberCols(); i++ ) fixedColsWidth += m_fieldsGrid->GetColSize( i ); - int colSize = std::max( fieldsWidth - fixedColsWidth, -1 ); - colSize = ( colSize == 0 ) ? -1 : colSize; // don't hide the column! - - m_fieldsGrid->SetColSize( 1, colSize ); + m_fieldsGrid->SetColSize( 1, std::max( 120, fieldsWidth - fixedColsWidth ) ); } diff --git a/eeschema/dialogs/panel_sym_lib_table.cpp b/eeschema/dialogs/panel_sym_lib_table.cpp index 513bb4a30b..360ef540a6 100644 --- a/eeschema/dialogs/panel_sym_lib_table.cpp +++ b/eeschema/dialogs/panel_sym_lib_table.cpp @@ -972,13 +972,8 @@ void PANEL_SYM_LIB_TABLE::adjustPathSubsGridColumns( int aWidth ) aWidth -= ( m_path_subs_grid->GetSize().x - m_path_subs_grid->GetClientSize().x ); m_path_subs_grid->AutoSizeColumn( 0 ); - - int remaining_width = aWidth - m_path_subs_grid->GetColSize( 0 ); - - if( remaining_width < 0 ) - m_path_subs_grid->SetColSize( 1, -1 ); - else - m_path_subs_grid->SetColSize( 1, remaining_width ); + m_path_subs_grid->SetColSize( 0, std::max( 72, m_path_subs_grid->GetColSize( 0 ) ) ); + m_path_subs_grid->SetColSize( 1, std::max( 120, aWidth - m_path_subs_grid->GetColSize( 0 ) ) ); } diff --git a/eeschema/dialogs/panel_template_fieldnames.cpp b/eeschema/dialogs/panel_template_fieldnames.cpp index ef0afe76a8..0833982b2d 100644 --- a/eeschema/dialogs/panel_template_fieldnames.cpp +++ b/eeschema/dialogs/panel_template_fieldnames.cpp @@ -233,7 +233,7 @@ void PANEL_TEMPLATE_FIELDNAMES::AdjustGridColumns( int aWidth ) // Account for scroll bars aWidth -= ( m_grid->GetSize().x - m_grid->GetClientSize().x ); - m_grid->SetColSize( 0, std::max( 40, aWidth - 2 * m_checkboxColWidth ) ); + m_grid->SetColSize( 0, std::max( 72, aWidth - 2 * m_checkboxColWidth ) ); m_grid->SetColSize( 1, m_checkboxColWidth ); m_grid->SetColSize( 2, m_checkboxColWidth ); } diff --git a/pcbnew/dialogs/dialog_fp_plugin_options.cpp b/pcbnew/dialogs/dialog_fp_plugin_options.cpp index f9a755bd51..2a4a336c13 100644 --- a/pcbnew/dialogs/dialog_fp_plugin_options.cpp +++ b/pcbnew/dialogs/dialog_fp_plugin_options.cpp @@ -276,9 +276,9 @@ private: int width = m_grid->GetClientRect().GetWidth(); m_grid->AutoSizeColumn( 0 ); - m_grid->SetColSize( 0, std::max( 120, m_grid->GetColSize( 0 ) ) ); + m_grid->SetColSize( 0, std::max( 72, m_grid->GetColSize( 0 ) ) ); - m_grid->SetColSize( 1, width - m_grid->GetColSize( 0 ) ); + m_grid->SetColSize( 1, std::max( 120, width - m_grid->GetColSize( 0 ) ) ); m_grid_widths_dirty = false; } diff --git a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp index e9ec89a9a5..9611ff7dc8 100644 --- a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp +++ b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp @@ -452,7 +452,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::AdjustNetclassGridColumns( int aWidth ) aWidth -= m_originalColWidths[ i ]; } - m_netclassGrid->SetColSize( 0, aWidth ); + m_netclassGrid->SetColSize( 0, std::max( 72, aWidth ) ); } diff --git a/pcbnew/dialogs/dialog_swap_layers.cpp b/pcbnew/dialogs/dialog_swap_layers.cpp index 699d2eca67..3a58067340 100644 --- a/pcbnew/dialogs/dialog_swap_layers.cpp +++ b/pcbnew/dialogs/dialog_swap_layers.cpp @@ -146,8 +146,8 @@ void DIALOG_SWAP_LAYERS::adjustGridColumns() // Account for scroll bars int width = KIPLATFORM::UI::GetUnobscuredSize( m_grid ).x; - m_grid->SetColSize( 0, width / 2 ); - m_grid->SetColSize( 1, width - m_grid->GetColSize( 0 ) ); + m_grid->SetColSize( 0, std::max( 40, width / 2 ) ); + m_grid->SetColSize( 1, std::max( 40, width - m_grid->GetColSize( 0 ) ) ); } diff --git a/pcbnew/dialogs/panel_fp_lib_table.cpp b/pcbnew/dialogs/panel_fp_lib_table.cpp index 35b545f08d..6e9fe3bc5b 100644 --- a/pcbnew/dialogs/panel_fp_lib_table.cpp +++ b/pcbnew/dialogs/panel_fp_lib_table.cpp @@ -954,11 +954,8 @@ void PANEL_FP_LIB_TABLE::adjustPathSubsGridColumns( int aWidth ) aWidth -= ( m_path_subs_grid->GetSize().x - m_path_subs_grid->GetClientSize().x ); m_path_subs_grid->AutoSizeColumn( 0 ); - - if( aWidth - m_path_subs_grid->GetColSize( 0 ) < 60 ) - m_path_subs_grid->SetColSize( 0, aWidth / 2 ); - - m_path_subs_grid->SetColSize( 1, aWidth - m_path_subs_grid->GetColSize( 0 ) ); + m_path_subs_grid->SetColSize( 0, std::max( 72, m_path_subs_grid->GetColSize( 0 ) ) ); + m_path_subs_grid->SetColSize( 1, std::max( 120, aWidth - m_path_subs_grid->GetColSize( 0 ) ) ); }