Allow wxBitmapBundle to specify its preferred bitmap size

Using bitmaps of preferred size avoids scaling and results in much
better appearance, so add methods allowing querying the bundle about the
bitmaps it supports and implement them in the various implementations.

This is not actually used anywhere yet, but will be soon.
This commit is contained in:
Vadim Zeitlin
2021-10-19 01:37:06 +01:00
parent 1cda648206
commit b20552116c
8 changed files with 203 additions and 0 deletions

View File

@@ -520,6 +520,13 @@ void MyFrame::PopulateToolbar(wxToolBarBase* toolBar)
return m_sizeDef;
}
wxSize GetPreferredSizeAtScale(double scale) const wxOVERRIDE
{
// We just scale the bitmap to fit the requested size, so
// we don't really have any preferences.
return m_sizeDef*scale;
}
wxBitmap GetBitmap(const wxSize& size) wxOVERRIDE
{
// In this simple implementation we don't bother caching