Fix size of the icon returned from wxFSVolume::GetIcon().
Calling SetHICON() is not enough, the icon size already needs to be set or, even better, CreateFromHICON(), which does both atomically, should be used. Closes #16672. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78116 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -614,11 +614,14 @@ wxIcon wxFSVolume::GetIcon(wxFSIconType type) const
|
|||||||
|
|
||||||
SHFILEINFO fi;
|
SHFILEINFO fi;
|
||||||
long rc = SHGetFileInfo(m_volName.t_str(), 0, &fi, sizeof(fi), flags);
|
long rc = SHGetFileInfo(m_volName.t_str(), 0, &fi, sizeof(fi), flags);
|
||||||
m_icons[type].SetHICON((WXHICON)fi.hIcon);
|
|
||||||
if (!rc || !fi.hIcon)
|
if (!rc || !fi.hIcon)
|
||||||
{
|
{
|
||||||
wxLogError(_("Cannot load icon from '%s'."), m_volName.c_str());
|
wxLogError(_("Cannot load icon from '%s'."), m_volName.c_str());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_icons[type].CreateFromHICON((WXHICON)fi.hIcon);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_icons[type];
|
return m_icons[type];
|
||||||
|
Reference in New Issue
Block a user