fix masking of disabled bitmaps with some themes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2008-07-18 02:45:48 +00:00
parent ccaa848d6d
commit 4a4a02acd1
4 changed files with 19 additions and 43 deletions

View File

@@ -787,16 +787,9 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos)
const char* stockid;
if (bitmap.IsOk())
{
GtkWidget* image;
if (bitmap.HasPixbuf())
image = gtk_image_new_from_pixbuf(bitmap.GetPixbuf());
else
{
GdkPixmap* mask = NULL;
if (bitmap.GetMask())
mask = bitmap.GetMask()->GetBitmap();
image = gtk_image_new_from_pixmap(bitmap.GetPixmap(), mask);
}
// always use pixbuf, because pixmap mask does not
// work with disabled images in some themes
GtkWidget* image = gtk_image_new_from_pixbuf(bitmap.GetPixbuf());
menuItem = gtk_image_menu_item_new_with_label("");
gtk_widget_show(image);
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuItem), image);