fixed loading the icons with non default size
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14167 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -512,18 +512,21 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon,
|
|||||||
// standard icons (although why one would want to do it considering that
|
// standard icons (although why one would want to do it considering that
|
||||||
// we already have wxApp::GetStdIcon() is unclear)
|
// we already have wxApp::GetStdIcon() is unclear)
|
||||||
#if defined(__WIN32__) && !defined(__SC__)
|
#if defined(__WIN32__) && !defined(__SC__)
|
||||||
if ( hasSize )
|
if ( !hasSize )
|
||||||
{
|
{
|
||||||
hicon = (HICON)::LoadImage(wxGetInstance(), name, IMAGE_ICON,
|
// use the actual size of the resource (as we don't specify
|
||||||
desiredWidth, desiredHeight,
|
// LR_DEFAULTSIZE)
|
||||||
LR_DEFAULTCOLOR);
|
desiredWidth =
|
||||||
}
|
desiredHeight = 0;
|
||||||
else
|
|
||||||
#endif // Win32
|
|
||||||
{
|
|
||||||
hicon = ::LoadIcon(wxGetInstance(), name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hicon = (HICON)::LoadImage(wxGetInstance(), name, IMAGE_ICON,
|
||||||
|
desiredWidth, desiredHeight,
|
||||||
|
LR_DEFAULTCOLOR);
|
||||||
|
#else // !Win32
|
||||||
|
hicon = ::LoadIcon(wxGetInstance(), name);
|
||||||
|
#endif // Win32/!Win32
|
||||||
|
|
||||||
// next check if it's not a standard icon
|
// next check if it's not a standard icon
|
||||||
if ( !hicon && !hasSize )
|
if ( !hicon && !hasSize )
|
||||||
{
|
{
|
||||||
@@ -552,7 +555,7 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon,
|
|||||||
icon->SetSize(size.x, size.y);
|
icon->SetSize(size.x, size.y);
|
||||||
|
|
||||||
// Override the found values with desired values
|
// Override the found values with desired values
|
||||||
if ( desiredWidth > -1 && desiredHeight > -1 )
|
if ( hasSize )
|
||||||
{
|
{
|
||||||
icon->SetSize(desiredWidth, desiredHeight);
|
icon->SetSize(desiredWidth, desiredHeight);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user