Add wxArtProvider::Get[Native]DIPSizeHint()

Also add "wxWindow* win = NULL" argument to the existing functions to
convert from DIPs using the given window instead of the default DPI
scaling factor.

Closes #22022.
This commit is contained in:
Vadim Zeitlin 2022-03-24 00:31:23 +01:00
parent 506f292be2
commit 108108e54e
7 changed files with 74 additions and 30 deletions

View file

@ -363,9 +363,9 @@ MyFrame::~MyFrame()
void MyFrame::InitImageList()
{
wxSize iconSize = wxArtProvider::GetSizeHint(wxART_LIST);
wxSize iconSize = wxArtProvider::GetSizeHint(wxART_LIST, this);
if ( iconSize == wxDefaultSize )
iconSize = wxSize(16, 16);
iconSize = FromDIP(wxSize(16, 16));
m_imageList = new wxImageList(iconSize.x, iconSize.y);