Use DIPs for the margins around text in wxGrid columns

Improve the appearance on high DPI displays where the margins were
previously too small under MSW.
This commit is contained in:
Vadim Zeitlin 2019-10-19 18:31:50 +02:00
parent f29b6564b1
commit 16619c5e77
2 changed files with 2 additions and 2 deletions

View File

@ -9401,7 +9401,7 @@ wxGrid::AutoSizeColOrRow(int colOrRow, bool setAsMin, wxGridDirection direction)
dc.SetFont( GetLabelFont() );
// We add some margin around text for better readability.
const int margin = column ? 10 : 6;
const int margin = FromDIP(column ? 10 : 6);
if ( column )
{

View File

@ -1019,7 +1019,7 @@ void GridTestCase::CheckFirstColAutoSize(int expected)
void GridTestCase::AutoSizeColumn()
{
// Hardcoded extra margin for the columns used in grid.cpp.
const int margin = 10;
const int margin = m_grid->FromDIP(10);
wxGridCellAttr *attr = m_grid->GetOrCreateCellAttr(0, 0);
wxGridCellRenderer *renderer = attr->GetRenderer(m_grid, 0, 0);