From 8ea3ec21dc1b1d7fbb0e83c45946aeb65d17b339 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Fri, 18 Jul 2008 02:45:48 +0000 Subject: [PATCH] fix masking of disabled bitmaps with some themes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@54676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 2 ++ src/gtk/menu.cpp | 15 +++------------ src/gtk/statbmp.cpp | 15 +++------------ 3 files changed, 8 insertions(+), 24 deletions(-) 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());