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
This commit is contained in:
Paul Cornett
2008-07-18 02:45:48 +00:00
parent 2821d49f4c
commit 8ea3ec21dc
3 changed files with 8 additions and 24 deletions

View File

@@ -125,6 +125,8 @@ wxMSW:
wxGTK:
- Fix masking of disabled bitmaps in wxMenuItem and wxStaticBitmap.
wxMac:

View File

@@ -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 )

View File

@@ -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());