Cleaned up wxArtProvider:

1. Move platform-specific code for both GetSizeHint() and GetBitmap()
   into platform-specific files.
2. Introduced GetNativeSizeHint() to make native sizes better accessible,
   without having to understand weird GetSizeHint() semantics.
3. Fixed GetNativeSizeHint() to return sensible values in non-GTK ports;
   it returns wxDefaultSize if it can't make a good guess instead of
   returning arbitrary value.
4. Use 16x16 icons on MSW instead of 16x15: it works and is more
   'natural' size.



git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56372 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2008-10-16 19:07:42 +00:00
parent ea91ff8e33
commit a158acac6d
17 changed files with 331 additions and 132 deletions

View File

@@ -19,14 +19,13 @@
#pragma hdrstop
#endif
#include "wx/artprov.h"
#ifndef WX_PRECOMP
#include "wx/image.h"
#endif
#if !defined(__WXUNIVERSAL__) && wxOSX_USE_CARBON
#include "wx/artprov.h"
#include "wx/image.h"
#if wxOSX_USE_CARBON
// ----------------------------------------------------------------------------
// wxMacArtProvider
@@ -109,6 +108,22 @@ wxBitmap wxMacArtProvider::CreateBitmap(const wxArtID& id,
return wxNullBitmap;
}
#endif // !defined(__WXUNIVERSAL__)
// ----------------------------------------------------------------------------
// wxArtProvider::GetNativeSizeHint()
// ----------------------------------------------------------------------------
/*static*/
wxSize wxArtProvider::GetNativeSizeHint(const wxArtClient& client)
{
if ( client == wxART_TOOLBAR )
{
// See http://developer.apple.com/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGIcons/chapter_15_section_9.html:
// "32 x 32 pixels is the recommended size"
return wxSize(32, 32);
}
return wxDefaultSize;
}
#endif // wxOSX_USE_CARBON