From ec2d9c9d4c82722e2ba691463dc45d79e2d75431 Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Thu, 21 Aug 2025 15:38:08 +0300 Subject: [PATCH] Add green color indication to length tuning status popup. --- pcbnew/generators/pcb_tuning_pattern.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pcbnew/generators/pcb_tuning_pattern.cpp b/pcbnew/generators/pcb_tuning_pattern.cpp index 8b4bd4aee9..7ffc04d25f 100644 --- a/pcbnew/generators/pcb_tuning_pattern.cpp +++ b/pcbnew/generators/pcb_tuning_pattern.cpp @@ -191,11 +191,14 @@ void TUNING_STATUS_VIEW_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const COLOR4D bg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ); COLOR4D normal = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNTEXT ); COLOR4D red; + COLOR4D green; - // Choose a red with reasonable contrasting with the background - double bg_h, bg_s, bg_l; + double bg_h, bg_s, bg_l; bg.ToHSL( bg_h, bg_s, bg_l ); - red.FromHSL( 0, 1.0, bg_l < 0.5 ? 0.7 : 0.3 ); + + // Choose colors with reasonable contrasting with the background + red.FromHSL( 0.0, 1.0, bg_l < 0.5 ? 0.7 : 0.3 ); + green.FromHSL( 120.0, 1.0, bg_l < 0.5 ? 0.8 : 0.2 ); if( viewFlipped ) textAttrs.m_Halign = GR_TEXT_H_ALIGN_RIGHT; @@ -231,14 +234,15 @@ void TUNING_STATUS_VIEW_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const textPos = GetPosition() + offset; textPos.y += KiROUND( headerDims.LinePitch * 1.3 ); + gal->SetStrokeColor( m_current < m_min || m_current > m_max ? red : green ); font->Draw( gal, m_currentText, textPos, textAttrs, KIFONT::METRICS::Default() ); textPos.x += glyphWidth * 11 + margin.x; - gal->SetStrokeColor( m_current < m_min ? red : normal ); + gal->SetStrokeColor( m_current < m_min ? red : green ); font->Draw( gal, m_minText, textPos, textAttrs, fontMetrics ); textPos.x += glyphWidth * 7 + margin.x; - gal->SetStrokeColor( m_current > m_max ? red : normal ); + gal->SetStrokeColor( m_current > m_max ? red : green ); font->Draw( gal, m_maxText, textPos, textAttrs, fontMetrics ); gal->Restore();