Adjust grid cols for large fonts and/or long translations.
Fixes: lp:1788495 * https://bugs.launchpad.net/kicad/+bug/1788495
This commit is contained in:
parent
51a128e323
commit
8957008c2a
|
@ -26,6 +26,9 @@
|
||||||
#include "wx_grid.h"
|
#include "wx_grid.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define MIN_GRIDCELL_MARGIN 3
|
||||||
|
|
||||||
|
|
||||||
void WX_GRID::SetTable( wxGridTableBase* aTable )
|
void WX_GRID::SetTable( wxGridTableBase* aTable )
|
||||||
{
|
{
|
||||||
// wxGrid::SetTable() messes up the column widths from wxFormBuilder so we have to save
|
// wxGrid::SetTable() messes up the column widths from wxFormBuilder so we have to save
|
||||||
|
@ -38,7 +41,12 @@ void WX_GRID::SetTable( wxGridTableBase* aTable )
|
||||||
wxGrid::SetTable( aTable );
|
wxGrid::SetTable( aTable );
|
||||||
|
|
||||||
for( int i = 0; i < GetNumberCols(); ++i )
|
for( int i = 0; i < GetNumberCols(); ++i )
|
||||||
SetColSize( i, formBuilderColWidths[ i ] );
|
{
|
||||||
|
// correct wxFormBuilder width for large fonts and/or long translations
|
||||||
|
int headingWidth = GetTextExtent( GetColLabelValue( i ) ).x + 2 * MIN_GRIDCELL_MARGIN;
|
||||||
|
|
||||||
|
SetColSize( i, std::max( formBuilderColWidths[ i ], headingWidth ) );
|
||||||
|
}
|
||||||
|
|
||||||
delete[] formBuilderColWidths;
|
delete[] formBuilderColWidths;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue