Add wxPreferencesPage::GetIcon() returning wxBitmapBundle

Allow returning a wxBitmapBundle rather than an individual wxBitmap.

Also make GetLargeIcon() non-pure even in wxOSX, as it now doesn't need
to be overridden if GetIcon() is -- but don't make GetIcon() pure
virtual neither to allow the existing code overriding GetLargeIcon() to
keep working.

This incidentally fixes the icons for the standard pages under macOS
broken by 388d322b68 (carry changes to toolbar over to prefs on osx,
2021-09-28), which replaced return statements with assignments,
resulting in the icon being set to the last value assigned to it instead
of the correct one -- this commit restores the previous control flow in
wxStockPreferencesPage::GetLargeIcon() (now called GetIcon()).

Closes #22187.
This commit is contained in:
Vadim Zeitlin
2022-03-10 18:54:58 +00:00
parent e5f195da33
commit 9b2f55833e
4 changed files with 29 additions and 23 deletions

View File

@@ -268,8 +268,8 @@ class PrefsPageTopics : public wxPreferencesPage
{
public:
virtual wxString GetName() const wxOVERRIDE { return "Topics"; }
virtual wxBitmap GetLargeIcon() const wxOVERRIDE
{ return wxArtProvider::GetBitmap(wxART_HELP, wxART_TOOLBAR); }
virtual wxBitmapBundle GetIcon() const wxOVERRIDE
{ return wxArtProvider::GetBitmapBundle(wxART_HELP, wxART_TOOLBAR); }
virtual wxWindow *CreateWindow(wxWindow *parent) wxOVERRIDE
{ return new PrefsPageTopicsPanel(parent); }
};