Grey out text in high-contrast mode.

This commit is contained in:
Simon Schubert 2015-05-27 22:13:51 +02:00 committed by Maciej Suminski
parent 89143851ba
commit cfeabde282
2 changed files with 21 additions and 1 deletions

View File

@ -39,6 +39,7 @@
#include <richio.h>
#include <class_drawpanel.h>
#include <macros.h>
#include <wxBasePcbFrame.h>
#include <msgpanel.h>
#include <base_units.h>
@ -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 ) )

View File

@ -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 )