From 2401ed587eca93b92a5a87c25804a51cf9bd8189 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 9 Jun 2020 18:36:26 +0200 Subject: [PATCH] eeschema, pcbnew: fix too narrow window showing the item color list Fixes #4610 https://gitlab.com/kicad/code/kicad/issues/4610 --- eeschema/dialogs/panel_eeschema_color_settings.cpp | 6 ++++++ pcbnew/dialogs/panel_pcbnew_color_settings.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/eeschema/dialogs/panel_eeschema_color_settings.cpp b/eeschema/dialogs/panel_eeschema_color_settings.cpp index e6da365046..0f86e1ec93 100644 --- a/eeschema/dialogs/panel_eeschema_color_settings.cpp +++ b/eeschema/dialogs/panel_eeschema_color_settings.cpp @@ -195,6 +195,12 @@ void PANEL_EESCHEMA_COLOR_SETTINGS::createSwatches() for( int layer : layers ) createSwatch( layer, LayerName( layer ) ); + + // Give a minimal width to m_colorsListWindow, in order to always having + // a full row shown + int min_width = m_colorsGridSizer->GetMinSize().x; + const int margin = 20; // A margin around the sizer + m_colorsListWindow->SetMinSize( wxSize( min_width + margin, -1 ) ); } diff --git a/pcbnew/dialogs/panel_pcbnew_color_settings.cpp b/pcbnew/dialogs/panel_pcbnew_color_settings.cpp index 9208304053..5a6daeb1f3 100644 --- a/pcbnew/dialogs/panel_pcbnew_color_settings.cpp +++ b/pcbnew/dialogs/panel_pcbnew_color_settings.cpp @@ -145,4 +145,10 @@ void PANEL_PCBNEW_COLOR_SETTINGS::createSwatches() createSwatch( layer, name ); } + + // Give a minimal width to m_colorsListWindow, in order to always having + // a full row shown + int min_width = m_colorsGridSizer->GetMinSize().x; + const int margin = 20; // A margin around the sizer + m_colorsListWindow->SetMinSize( wxSize( min_width + margin, -1 ) ); }