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
|
// common part of all ctors
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
|
// update the images if we use them on DPI change
|
||||||
|
void WXHandleDPIChanged(wxDPIChangedEvent& event);
|
||||||
|
|
||||||
|
|
||||||
// internal border
|
// internal border
|
||||||
unsigned int m_internalBorder;
|
unsigned int m_internalBorder;
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ wxBEGIN_EVENT_TABLE(wxBookCtrlBase, wxControl)
|
|||||||
#if wxUSE_HELP
|
#if wxUSE_HELP
|
||||||
EVT_HELP(wxID_ANY, wxBookCtrlBase::OnHelp)
|
EVT_HELP(wxID_ANY, wxBookCtrlBase::OnHelp)
|
||||||
#endif // wxUSE_HELP
|
#endif // wxUSE_HELP
|
||||||
|
|
||||||
|
EVT_DPI_CHANGED(wxBookCtrlBase::WXHandleDPIChanged)
|
||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -291,6 +293,16 @@ wxSize wxBookCtrlBase::GetControllerSize() const
|
|||||||
// miscellaneous stuff
|
// miscellaneous stuff
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxBookCtrlBase::WXHandleDPIChanged(wxDPIChangedEvent& event)
|
||||||
|
{
|
||||||
|
if ( HasImages() )
|
||||||
|
{
|
||||||
|
OnImagesChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
|
|
||||||
#if wxUSE_HELP
|
#if wxUSE_HELP
|
||||||
|
|
||||||
void wxBookCtrlBase::OnHelp(wxHelpEvent& event)
|
void wxBookCtrlBase::OnHelp(wxHelpEvent& event)
|
||||||
|
|||||||
Reference in New Issue
Block a user