diff --git a/docs/changes.txt b/docs/changes.txt index 23dc7dc0e8..195569b43c 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -125,6 +125,8 @@ wxMSW: wxGTK: +- Fix masking of disabled bitmaps in wxMenuItem and wxStaticBitmap. + wxMac: diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index d635584f0c..f142ceb09b 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -1145,18 +1145,9 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos) wxASSERT_MSG( mitem->GetKind() == wxITEM_NORMAL, _T("only normal menu items can have bitmaps") ); - if ( bitmap.HasPixbuf() ) - { - image = gtk_image_new_from_pixbuf(bitmap.GetPixbuf()); - } - else - { - GdkPixmap *gdk_pixmap = bitmap.GetPixmap(); - GdkBitmap *gdk_bitmap = bitmap.GetMask() ? - bitmap.GetMask()->GetBitmap() : - (GdkBitmap*) NULL; - image = gtk_image_new_from_pixmap( gdk_pixmap, gdk_bitmap ); - } + // always use pixbuf, because pixmap mask does not + // work with disabled images in some themes + image = gtk_image_new_from_pixbuf(bitmap.GetPixbuf()); } if ( image ) diff --git a/src/gtk/statbmp.cpp b/src/gtk/statbmp.cpp index 7bc4035a18..b42b269d79 100644 --- a/src/gtk/statbmp.cpp +++ b/src/gtk/statbmp.cpp @@ -66,18 +66,9 @@ void wxStaticBitmap::SetBitmap( const wxBitmap &bitmap ) if (m_bitmap.Ok()) { - GdkBitmap *mask = (GdkBitmap *) NULL; - if (m_bitmap.GetMask()) - mask = m_bitmap.GetMask()->GetBitmap(); - - if (m_bitmap.HasPixbuf()) - { - gtk_image_set_from_pixbuf(GTK_IMAGE(m_widget), - m_bitmap.GetPixbuf()); - } - else - gtk_image_set_from_pixmap(GTK_IMAGE(m_widget), - m_bitmap.GetPixmap(), mask); + // always use pixbuf, because pixmap mask does not + // work with disabled images in some themes + gtk_image_set_from_pixbuf(GTK_IMAGE(m_widget), m_bitmap.GetPixbuf()); InvalidateBestSize(); SetSize(GetBestSize());