diff --git a/pcbnew/footprint_preview_panel.cpp b/pcbnew/footprint_preview_panel.cpp index a79ab70e76..1e84eafc13 100644 --- a/pcbnew/footprint_preview_panel.cpp +++ b/pcbnew/footprint_preview_panel.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -320,6 +320,11 @@ void FOOTPRINT_PREVIEW_PANEL::renderFootprint( std::shared_ptr 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( painter->GetSettings() ); + settings->SetContrastModeDisplay( HIGH_CONTRAST_MODE::NORMAL ); + GetView()->Add( aModule.get() ); GetView()->SetVisible( aModule.get(), true ); GetView()->Update( aModule.get(), KIGFX::ALL ); diff --git a/pcbnew/pcb_painter.h b/pcbnew/pcb_painter.h index 221b2f50ed..ad7e6883c9 100644 --- a/pcbnew/pcb_painter.h +++ b/pcbnew/pcb_painter.h @@ -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 m_hiddenNets; - ///> How to display inactive layers + ///> How to display inactive layers (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN ) HIGH_CONTRAST_MODE m_contrastModeDisplay; };