X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/abdeb9e7006488bf917d90048fcd0cbe22f44a71..e219748f2ca2fc482eb3cc291b92c5f086ed1775:/src/gtk/bmpbuttn.cpp diff --git a/src/gtk/bmpbuttn.cpp b/src/gtk/bmpbuttn.cpp index 17bc64454f..795f5c5eb9 100644 --- a/src/gtk/bmpbuttn.cpp +++ b/src/gtk/bmpbuttn.cpp @@ -137,10 +137,7 @@ bool wxBitmapButton::Create( wxWindow *parent, return FALSE; } - m_bmpNormal = - m_bmpDisabled = - m_bmpFocus = - m_bmpSelected = bitmap; + m_bmpNormal = bitmap; m_widget = gtk_button_new(); @@ -193,18 +190,20 @@ wxString wxBitmapButton::GetLabel() const return wxControl::GetLabel(); } -void wxBitmapButton::ApplyWidgetStyle() +void wxBitmapButton::DoApplyWidgetStyle(GtkRcStyle *style) { if ( !BUTTON_CHILD(m_widget) ) return; - wxButton::ApplyWidgetStyle(); + wxButton::DoApplyWidgetStyle(style); } void wxBitmapButton::OnSetBitmap() { wxCHECK_RET( m_widget != NULL, wxT("invalid bitmap button") ); + InvalidateBestSize(); + wxBitmap the_one; if (!m_isEnabled) the_one = m_bmpDisabled; @@ -258,6 +257,7 @@ wxSize wxBitmapButton::DoGetBestSize() const best.x = m_bmpNormal.GetWidth()+border; best.y = m_bmpNormal.GetHeight()+border; } + CacheBestSize(best); return best; }