Fix setting size of wxStaticBitmap in wxOSX too
This is the same change as was done in the previous commit for wxGenericStaticBitmap, see that commit message for more details.
This commit is contained in:
@@ -35,12 +35,6 @@ public:
|
||||
virtual ScaleMode GetScaleMode() const wxOVERRIDE { return m_scaleMode; }
|
||||
|
||||
private:
|
||||
wxSize GetBitmapSize()
|
||||
{
|
||||
return m_bitmap.IsOk() ? m_bitmap.GetScaledSize()
|
||||
: wxSize(16, 16); // this is completely arbitrary
|
||||
}
|
||||
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
wxBitmap m_bitmap;
|
||||
|
@@ -47,7 +47,12 @@ bool wxStaticBitmap::Create(wxWindow *parent,
|
||||
|
||||
MacPostControlCreate( pos, size );
|
||||
|
||||
SetBitmap(bitmap);
|
||||
// Don't call SetBitmap() here, as we don't need to change the size nor
|
||||
// refresh the window here.
|
||||
m_bitmap = bitmap;
|
||||
GetPeer()->SetBitmap(bitmap);
|
||||
|
||||
SetInitialSize(size);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -56,10 +61,10 @@ bool wxStaticBitmap::Create(wxWindow *parent,
|
||||
void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
|
||||
{
|
||||
m_bitmap = bitmap;
|
||||
SetInitialSize(GetBitmapSize());
|
||||
|
||||
GetPeer()->SetBitmap(bitmap);
|
||||
|
||||
InvalidateBestSize();
|
||||
SetSize(GetBestSize());
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user