From 4be5fde7213acb46d20919fa9c0cb50eae479bfd Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Tue, 13 Feb 2024 21:49:53 +0100 Subject: [PATCH] Don't handle unset background colour as black in wxQt Unset background colour actually means to use the default one, which is still not the case for wxQt if the background had been previously changed, but at the very least it doesn't change it to black any longer. This commit is best viewed ignoring whitespace-only changes. --- src/qt/window.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qt/window.cpp b/src/qt/window.cpp index 2a7d64c6d4..eed343f218 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -1294,8 +1294,11 @@ bool wxWindowQt::SetBackgroundColour(const wxColour& colour) if ( !wxWindowBase::SetBackgroundColour(colour) ) return false; - QWidget *widget = QtGetParentWidget(); - wxQtChangeRoleColour(widget->backgroundRole(), widget, colour); + if ( colour.IsOk() ) + { + QWidget *widget = QtGetParentWidget(); + wxQtChangeRoleColour(widget->backgroundRole(), widget, colour); + } return true; }