From 8b47c94f6ea01e8fb316e497b78836a600ba811b Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 27 Feb 2023 08:32:57 +0100 Subject: [PATCH] PANEL_COLOR_SETTINGS: swap swatches and texts to avoid annoying truncation. In some languages, the texts can be long, and create truncation of the left column. So if the left column shows swatches they are truncated, or not visible Truncating long texts is less annoying. Fixes #14052 https://gitlab.com/kicad/code/kicad/issues/14052 --- common/dialogs/panel_color_settings.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/dialogs/panel_color_settings.cpp b/common/dialogs/panel_color_settings.cpp index b4c89ff252..974dbd1af2 100644 --- a/common/dialogs/panel_color_settings.cpp +++ b/common/dialogs/panel_color_settings.cpp @@ -262,8 +262,11 @@ void PANEL_COLOR_SETTINGS::createSwatch( int aLayer, const wxString& aName ) defaultColor, SWATCH_MEDIUM ); swatch->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - m_colorsGridSizer->Add( label, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxLEFT, 5 ); + // Display the swatches in the left column and the layer name in the right column + // The right column is sometimes (depending on the translation) truncated for long texts. + // We cannot allow swatches to be truncated or not shown m_colorsGridSizer->Add( swatch, 0, wxALIGN_CENTER_VERTICAL | wxALL, 3 ); + m_colorsGridSizer->Add( label, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxLEFT, 5 ); m_labels[aLayer] = label; m_swatches[aLayer] = swatch;