Try a bigger hammer to keep wxFormBuilder from messing up grid fonts.
Fixes https://gitlab.com/kicad/code/kicad/issues/13547
This commit is contained in:
parent
7361414f4c
commit
8ac0543a5e
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 2018-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -103,6 +103,7 @@ WX_GRID::WX_GRID( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxS
|
||||||
|
|
||||||
// Make sure the GUI font scales properly
|
// Make sure the GUI font scales properly
|
||||||
SetDefaultCellFont( KIUI::GetControlFont( this ) );
|
SetDefaultCellFont( KIUI::GetControlFont( this ) );
|
||||||
|
SetLabelFont( KIUI::GetControlFont( this ) );
|
||||||
|
|
||||||
if( GetColLabelSize() > 0 )
|
if( GetColLabelSize() > 0 )
|
||||||
SetColLabelSize( GetColLabelSize() + 4 );
|
SetColLabelSize( GetColLabelSize() + 4 );
|
||||||
|
@ -191,6 +192,20 @@ void WX_GRID::SetTable( wxGridTableBase* aTable, bool aTakeOwnership )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool WX_GRID::Show( bool aShow )
|
||||||
|
{
|
||||||
|
// Don't let wxFormBuilder override the fonts. It's always the wrong answer as it will set
|
||||||
|
// a fixed-size, non-scaling, non-HiDPI-aware font.
|
||||||
|
if( aShow )
|
||||||
|
{
|
||||||
|
SetDefaultCellFont( KIUI::GetControlFont( this ) );
|
||||||
|
SetLabelFont( KIUI::GetControlFont( this ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
return wxGrid::Show( aShow );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void WX_GRID::onGridCellSelect( wxGridEvent& aEvent )
|
void WX_GRID::onGridCellSelect( wxGridEvent& aEvent )
|
||||||
{
|
{
|
||||||
// Highlight the selected cell.
|
// Highlight the selected cell.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 2018-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -136,6 +136,8 @@ public:
|
||||||
DeleteRows( 0, GetNumberRows() );
|
DeleteRows( 0, GetNumberRows() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Show( bool aShow ) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* A re-implementation of wxGrid::DrawColLabel which left-aligns the first column and draws
|
* A re-implementation of wxGrid::DrawColLabel which left-aligns the first column and draws
|
||||||
|
|
Loading…
Reference in New Issue