Update images when DPI changes in wxBookCtrlBase-derived classes
Just pretend that the images themselves have changed, this should be enough to recreate wxImageList from the bundle using the new scale factor in UpdateImageListIfNecessary().
This commit is contained in:
@@ -360,6 +360,10 @@ private:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// update the images if we use them on DPI change
|
||||
void WXHandleDPIChanged(wxDPIChangedEvent& event);
|
||||
|
||||
|
||||
// internal border
|
||||
unsigned int m_internalBorder;
|
||||
|
||||
|
||||
@@ -41,6 +41,8 @@ wxBEGIN_EVENT_TABLE(wxBookCtrlBase, wxControl)
|
||||
#if wxUSE_HELP
|
||||
EVT_HELP(wxID_ANY, wxBookCtrlBase::OnHelp)
|
||||
#endif // wxUSE_HELP
|
||||
|
||||
EVT_DPI_CHANGED(wxBookCtrlBase::WXHandleDPIChanged)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -291,6 +293,16 @@ wxSize wxBookCtrlBase::GetControllerSize() const
|
||||
// miscellaneous stuff
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxBookCtrlBase::WXHandleDPIChanged(wxDPIChangedEvent& event)
|
||||
{
|
||||
if ( HasImages() )
|
||||
{
|
||||
OnImagesChanged();
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
#if wxUSE_HELP
|
||||
|
||||
void wxBookCtrlBase::OnHelp(wxHelpEvent& event)
|
||||
|
||||
Reference in New Issue
Block a user