From cfeabde282cd4941048a9041ae837e92fcf0bba3 Mon Sep 17 00:00:00 2001 From: Simon Schubert <2@0x2c.org> Date: Wed, 27 May 2015 22:13:51 +0200 Subject: [PATCH] Grey out text in high-contrast mode. --- pcbnew/class_pcb_text.cpp | 10 ++++++++++ pcbnew/class_text_mod.cpp | 12 +++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pcbnew/class_pcb_text.cpp b/pcbnew/class_pcb_text.cpp index 37b991490c..e352b031df 100644 --- a/pcbnew/class_pcb_text.cpp +++ b/pcbnew/class_pcb_text.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -97,6 +98,15 @@ void TEXTE_PCB::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, if( displ_opts && displ_opts->m_DisplayDrawItemsFill == SKETCH ) fillmode = SKETCH; + // shade text if high contrast mode is active + if( ( DrawMode & GR_ALLOW_HIGHCONTRAST ) && displ_opts && displ_opts->m_ContrastModeDisplay ) + { + LAYER_ID curr_layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer; + + if( !IsOnLayer( curr_layer ) ) + ColorTurnToDarkDarkGray( &color ); + } + EDA_COLOR_T anchor_color = UNSPECIFIED_COLOR; if( brd->IsElementVisible( ANCHOR_VISIBLE ) ) diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp index a90b51e234..26b0374d33 100644 --- a/pcbnew/class_text_mod.cpp +++ b/pcbnew/class_text_mod.cpp @@ -288,8 +288,18 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE draw_mode, color = brd->GetVisibleElementColor( MOD_TEXT_INVISIBLE ); } - // Draw mode compensation for the width DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions(); + + // shade text if high contrast mode is active + if( ( draw_mode & GR_ALLOW_HIGHCONTRAST ) && displ_opts->m_ContrastModeDisplay ) + { + LAYER_ID curr_layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer; + + if( !IsOnLayer( curr_layer ) ) + ColorTurnToDarkDarkGray( &color ); + } + + // Draw mode compensation for the width int width = m_Thickness; if( displ_opts && displ_opts->m_DisplayModTextFill == SKETCH )