From 833ae03c6a80dea21b775fa871af0f32289e0bd4 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sun, 29 Dec 2019 09:14:08 -0800 Subject: [PATCH] Draw bitmap in disabled state when wxStaticBitmap control is not enabled on GTK3 See #18638 --- src/gtk/statbmp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gtk/statbmp.cpp b/src/gtk/statbmp.cpp index 71a16da072..e137f10f49 100644 --- a/src/gtk/statbmp.cpp +++ b/src/gtk/statbmp.cpp @@ -19,7 +19,7 @@ extern "C" { static gboolean image_draw(GtkWidget* widget, cairo_t* cr, wxStaticBitmap* win) { - const wxBitmap bitmap(win->GetBitmap()); + wxBitmap bitmap(win->GetBitmap()); if (!bitmap.IsOk() || bitmap.GetScaleFactor() <= 1) return false; @@ -30,6 +30,8 @@ static gboolean image_draw(GtkWidget* widget, cairo_t* cr, wxStaticBitmap* win) const wxSize size(bitmap.GetScaledSize()); int x = (alloc.width - size.x) / 2; int y = (alloc.height - size.y) / 2; + if (!win->IsEnabled()) + bitmap = bitmap.CreateDisabled(); bitmap.Draw(cr, x, y); return true; }