From 59b29a3a71939733a40542c58d07c38efc8b593c Mon Sep 17 00:00:00 2001 From: Kolya Kosenko Date: Fri, 4 Mar 2016 14:47:32 +0100 Subject: [PATCH] Reset wxStaticBitmap image when passed empty bitmap in wxGTK This makes the behaviour consistent with the other ports. Closes #17420. --- src/gtk/statbmp.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gtk/statbmp.cpp b/src/gtk/statbmp.cpp index bfe5c1ef38..4a56efc6f1 100644 --- a/src/gtk/statbmp.cpp +++ b/src/gtk/statbmp.cpp @@ -59,15 +59,15 @@ void wxStaticBitmap::SetBitmap( const wxBitmap &bitmap ) { m_bitmap = bitmap; + // always use pixbuf, because pixmap mask does not + // work with disabled images in some themes if (m_bitmap.IsOk()) - { - // 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()); + else + gtk_image_set_from_pixbuf(GTK_IMAGE(m_widget), NULL); - InvalidateBestSize(); - SetSize(GetBestSize()); - } + InvalidateBestSize(); + SetSize(GetBestSize()); } // static