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/branches/WX_3_0_BRANCH@78122 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -594,6 +594,7 @@ wxMSW:
|
|||||||
- Fix best height of wxSlider with labels but without ticks (Artur Wieczorek).
|
- Fix best height of wxSlider with labels but without ticks (Artur Wieczorek).
|
||||||
- Fix initial text value of wxSpinCtrlDouble (Laurent Poujoulat).
|
- Fix initial text value of wxSpinCtrlDouble (Laurent Poujoulat).
|
||||||
- Fix best size calculation for bitmaps with buttons (Artur Wieczorek).
|
- Fix best size calculation for bitmaps with buttons (Artur Wieczorek).
|
||||||
|
- Fix size of the icon returned from wxFSVolume::GetIcon() (troelsk).
|
||||||
|
|
||||||
|
|
||||||
3.0.2: (released 2014-10-06)
|
3.0.2: (released 2014-10-06)
|
||||||
|
@@ -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