Scale bitmap to wxPropertyGrid's row height

By design only bitmaps lower than row height are displayed within the cells.
Because on every platform default row height can vary so bitmap has to be explicitly scaled to the row height to ensure that it will be initially displayed on every platform.

Closes #18310.
This commit is contained in:
Artur Wieczorek
2018-12-23 22:13:43 +01:00
parent 270ad54abe
commit 79b71cf4ff

View File

@@ -1157,7 +1157,8 @@ void FormMain::PopulateWithStandardItems ()
// Set test information for cells in columns 3 and 4 // Set test information for cells in columns 3 and 4
// (reserve column 2 for displaying units) // (reserve column 2 for displaying units)
wxPropertyGridIterator it; wxPropertyGridIterator it;
wxBitmap bmp = wxArtProvider::GetBitmap(wxART_FOLDER); int bmpH = pg->GetGrid()->GetRowHeight() - 2;
wxBitmap bmp = wxArtProvider::GetBitmap(wxART_FOLDER, wxART_OTHER, wxSize(bmpH, bmpH));
for ( it = pg->GetGrid()->GetIterator(); for ( it = pg->GetGrid()->GetIterator();
!it.AtEnd(); !it.AtEnd();