X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d275c7eb8420c81e97a8b308c60c27d9856b58f9..7509fa8caa43a1327175dd5fa8b7caf6b647e81b:/src/msw/gdiimage.cpp diff --git a/src/msw/gdiimage.cpp b/src/msw/gdiimage.cpp index 3ead2479d1..87fb6add43 100644 --- a/src/msw/gdiimage.cpp +++ b/src/msw/gdiimage.cpp @@ -175,10 +175,10 @@ private: // wxWin macros // ---------------------------------------------------------------------------- - IMPLEMENT_DYNAMIC_CLASS(wxBMPFileHandler, wxBitmapHandler) - IMPLEMENT_DYNAMIC_CLASS(wxBMPResourceHandler, wxBitmapHandler) - IMPLEMENT_DYNAMIC_CLASS(wxICOFileHandler, wxGDIImageHandler) - IMPLEMENT_DYNAMIC_CLASS(wxICOResourceHandler, wxGDIImageHandler) +IMPLEMENT_DYNAMIC_CLASS(wxBMPFileHandler, wxBitmapHandler) +IMPLEMENT_DYNAMIC_CLASS(wxBMPResourceHandler, wxBitmapHandler) +IMPLEMENT_DYNAMIC_CLASS(wxICOFileHandler, wxObject) +IMPLEMENT_DYNAMIC_CLASS(wxICOResourceHandler, wxObject) // ---------------------------------------------------------------------------- // private functions @@ -511,6 +511,9 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon, // try to load the icon from this program first to allow overriding the // standard icons (although why one would want to do it considering that // we already have wxApp::GetStdIcon() is unclear) + + // note that we can't just always call LoadImage() because it seems to do + // some icon rescaling internally which results in very ugly 16x16 icons #if defined(__WIN32__) && !defined(__SC__) if ( hasSize ) { @@ -519,7 +522,7 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon, LR_DEFAULTCOLOR); } else -#endif // Win32 +#endif // Win32/!Win32 { hicon = ::LoadIcon(wxGetInstance(), name); } @@ -551,12 +554,6 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon, wxSize size = GetHiconSize(hicon); icon->SetSize(size.x, size.y); - // Override the found values with desired values - if ( desiredWidth > -1 && desiredHeight > -1 ) - { - icon->SetSize(desiredWidth, desiredHeight); - } - icon->SetHICON((WXHICON)hicon); return icon->Ok();