FOOTPRINT_PREVIEW_PANEL: Ensure we are never using the high contrast mode

to display the selected footprint

Fixes #4980
https://gitlab.com/kicad/code/kicad/issues/4980
This commit is contained in:
jean-pierre charras 2020-07-26 13:17:38 +02:00
parent 4d2bc1fa54
commit 124afa5fc4
2 changed files with 16 additions and 2 deletions

View File

@ -33,7 +33,7 @@
#include <io_mgr.h>
#include <kiway.h>
#include <math/box2.h>
#include <painter.h>
#include <pcb_painter.h>
#include <pcb_draw_panel_gal.h>
#include <pcb_edit_frame.h>
#include <pgm_base.h>
@ -320,6 +320,11 @@ void FOOTPRINT_PREVIEW_PANEL::renderFootprint( std::shared_ptr<MODULE> aModule )
aModule->SetParent( m_dummyBoard.get() );
// Ensure we are not using the high contrast mode to display the selected footprint
KIGFX::PAINTER* painter = GetView()->GetPainter();
auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->GetSettings() );
settings->SetContrastModeDisplay( HIGH_CONTRAST_MODE::NORMAL );
GetView()->Add( aModule.get() );
GetView()->SetVisible( aModule.get(), true );
GetView()->Update( aModule.get(), KIGFX::ALL );

View File

@ -179,6 +179,15 @@ public:
const COLOR4D& GetCursorColor() override { return m_layerColors[ LAYER_CURSOR ]; }
/** Switch the contrast mode setting (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN )
* to control how the non active layers are shown
*/
void SetContrastModeDisplay( HIGH_CONTRAST_MODE aMode ) { m_contrastModeDisplay = aMode; }
/** return the contrast mode setting (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN )
*/
HIGH_CONTRAST_MODE GetContrastModeDisplay() { return m_contrastModeDisplay; }
inline bool GetCurvedRatsnestLinesEnabled() const { return m_curvedRatsnestlines; }
inline bool GetGlobalRatsnestLinesEnabled() const { return m_globalRatsnestlines; }
@ -253,7 +262,7 @@ protected:
///> Set of net codes that should not have their ratsnest displayed
std::set<int> m_hiddenNets;
///> How to display inactive layers
///> How to display inactive layers (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN )
HIGH_CONTRAST_MODE m_contrastModeDisplay;
};