From 9405817a4dba282864bd9d16d5fdbfb5d4269255 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 4 Sep 2022 21:00:44 +0100 Subject: [PATCH] Improve contrast of status popup text on Mac. Also works around an issue where GetBackgroundColor() returns black (with a 40% alpha) on Mac. --- pcbnew/router/pns_tune_status_popup.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pcbnew/router/pns_tune_status_popup.cpp b/pcbnew/router/pns_tune_status_popup.cpp index 964c2a00eb..8c9dad738d 100644 --- a/pcbnew/router/pns_tune_status_popup.cpp +++ b/pcbnew/router/pns_tune_status_popup.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2014-2015 CERN - * Copyright (C) 2016-2019 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2016-2022 KiCad Developers, see AUTHORS.txt for contributors. * Author: Tomasz Wlostowski * * This program is free software: you can redistribute it and/or modify it @@ -23,6 +23,7 @@ #include "pns_tune_status_popup.h" #include "pns_router.h" #include "pns_meander_placer.h" +#include void PNS_TUNE_STATUS_POPUP::UpdateStatus( PNS::ROUTER* aRouter ) { @@ -36,7 +37,7 @@ void PNS_TUNE_STATUS_POPUP::UpdateStatus( PNS::ROUTER* aRouter ) SetText( placer->TuningInfo( frame->GetUserUnits() ) ); // Determine the background color first and choose a contrasting value - COLOR4D bg( m_panel->GetBackgroundColour() ); + COLOR4D bg( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); double h, s, l; bg.ToHSL( h, s, l ); @@ -46,16 +47,18 @@ void PNS_TUNE_STATUS_POPUP::UpdateStatus( PNS::ROUTER* aRouter ) if( l < 0.5 ) SetTextColor( wxColor( 127, 200, 127 ) ); else - SetTextColor( wxColor( 0, 128, 0 ) ); + SetTextColor( wxColor( 0, 92, 0 ) ); break; + case PNS::MEANDER_PLACER::TOO_SHORT: if( l < 0.5 ) SetTextColor( wxColor( 242, 100, 126 ) ); else - SetTextColor( wxColor( 128, 64, 64 ) ); + SetTextColor( wxColor( 122, 0, 0 ) ); break; + case PNS::MEANDER_PLACER::TOO_LONG: if( l < 0.5 ) SetTextColor( wxColor( 66, 184, 235 ) );