git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54676
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
if (!the_one.Ok())
return;
if (!the_one.Ok())
return;
- GtkWidget *child = GTK_BIN(m_widget)->child;
- if (child == NULL)
+ GtkWidget* image = GTK_BIN(m_widget)->child;
+ if (image == NULL)
- // initial bitmap
- GtkWidget *pixmap =
- gtk_image_new_from_pixbuf(the_one.GetPixbuf());
-
- gtk_widget_show(pixmap);
- gtk_container_add(GTK_CONTAINER(m_widget), pixmap);
- }
- else
- { // subsequent bitmaps
- GtkImage *pixmap = GTK_IMAGE(child);
- gtk_image_set_from_pixbuf(pixmap, the_one.GetPixbuf());
+ image = gtk_image_new();
+ gtk_widget_show(image);
+ gtk_container_add(GTK_CONTAINER(m_widget), image);
+ // always use pixbuf, because pixmap mask does not
+ // work with disabled images in some themes
+ gtk_image_set_from_pixbuf(GTK_IMAGE(image), the_one.GetPixbuf());
}
wxSize wxBitmapButton::DoGetBestSize() const
}
wxSize wxBitmapButton::DoGetBestSize() const
const char* stockid;
if (bitmap.IsOk())
{
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);
menuItem = gtk_image_menu_item_new_with_label("");
gtk_widget_show(image);
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuItem), image);
-#include "gdk/gdk.h"
-#include "gtk/gtk.h"
//-----------------------------------------------------------------------------
// wxStaticBitmap
//-----------------------------------------------------------------------------
// wxStaticBitmap
- 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());
InvalidateBestSize();
SetSize(GetBestSize());
GtkWidget* image = ((GtkBin*)m_widget)->child;
if (image == NULL)
{
GtkWidget* image = ((GtkBin*)m_widget)->child;
if (image == NULL)
{
- // initial bitmap
- image = gtk_image_new_from_pixbuf(m_bitmap.GetPixbuf());
+ image = gtk_image_new();
gtk_widget_show(image);
gtk_container_add((GtkContainer*)m_widget, image);
}
gtk_widget_show(image);
gtk_container_add((GtkContainer*)m_widget, image);
}
- else
- { // subsequent bitmaps
- gtk_image_set_from_pixbuf((GtkImage*)image, m_bitmap.GetPixbuf());
- }
+ // always use pixbuf, because pixmap mask does not
+ // work with disabled images in some themes
+ gtk_image_set_from_pixbuf((GtkImage*)image, m_bitmap.GetPixbuf());
}
bool wxBitmapToggleButton::Enable(bool enable /*=true*/)
}
bool wxBitmapToggleButton::Enable(bool enable /*=true*/)