Add wxBitmapBundle::GetConsensusSizeFor()

Move the code for determining the size preferred by a bunch of bitmap
bundles from wxToolBar to wxBitmapBundle itself to allow reusing it from
other classes.

No real changes, this is just a refactoring.

This commit is best viewed with --color-moved git option.
This commit is contained in:
Vadim Zeitlin 2021-10-31 20:40:06 +01:00
parent 0df49f0a54
commit 55819925dc
3 changed files with 115 additions and 75 deletions

View file

@ -122,6 +122,16 @@ public:
// Access implementation
wxBitmapBundleImpl* GetImpl() const { return m_impl.get(); }
// Implementation only from now on.
// Get the bitmap size preferred by the majority of the elements of the
// bundles at the scale appropriate for the given scale.
static wxSize
GetConsensusSizeFor(wxWindow* win,
const wxVector<wxBitmapBundle>& bundles,
const wxSize& sizeDefault);
private:
typedef wxObjectDataPtr<wxBitmapBundleImpl> wxBitmapBundleImplPtr;