diff --git a/common/settings/app_settings.cpp b/common/settings/app_settings.cpp index 06855872a1..b281aa14fe 100644 --- a/common/settings/app_settings.cpp +++ b/common/settings/app_settings.cpp @@ -71,6 +71,15 @@ APP_SETTINGS_BASE::APP_SETTINGS_BASE( const std::string& aFilename, int aSchemaV &m_Graphics.canvas_type, EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO ) ); #endif + m_params.emplace_back( new PARAM( + "graphics.highlight_factor", &m_Graphics.highlight_factor, 0.5f, 0.0, 1.0f ) ); + + m_params.emplace_back( new PARAM( + "graphics.select_factor", &m_Graphics.select_factor, 0.75f, 0.0, 1.0f ) ); + + m_params.emplace_back( new PARAM( + "graphics.high_contrast_factor", &m_Graphics.high_contrast_factor, 0.35f, 0.0, 1.0f ) ); + m_params.emplace_back( new PARAM( "color_picker.default_tab", &m_ColorPicker.default_tab, 0 ) ); diff --git a/include/render_settings.h b/include/render_settings.h index 7e6e8c5dcd..3ed3ac553c 100644 --- a/include/render_settings.h +++ b/include/render_settings.h @@ -228,6 +228,10 @@ public: m_outlineWidth = aWidth; } + void SetHighlightFactor( float aFactor ) { m_highlightFactor = aFactor; } + void SetSelectFactor( float aFactor ) { m_selectFactor = aFactor; } + void SetHighContrastFactor( float aFactor ) { m_hiContrastFactor = aFactor; } + // TODO: these can go away once we have Cairo-based printing wxDC* GetPrintDC() { return m_printDC; } void SetPrintDC( wxDC* aDC ) { m_printDC = aDC; } diff --git a/include/settings/app_settings.h b/include/settings/app_settings.h index 147f3471d3..0295aaf656 100644 --- a/include/settings/app_settings.h +++ b/include/settings/app_settings.h @@ -105,7 +105,10 @@ public: struct GRAPHICS { - int canvas_type; + int canvas_type; + float highlight_factor; ///< How much to brighten highlighted objects by + float select_factor; ///< How much to brighten selected objects by + float high_contrast_factor; ///< How much to darken inactive layers by }; struct COLOR_PICKER diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index 426a27dd2d..87194fde8e 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -652,6 +652,15 @@ void PCB_BASE_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg ) m_DisplayOptions = cfg->m_Display; m_PolarCoords = cfg->m_PolarCoords; } + + RENDER_SETTINGS* rs = GetCanvas()->GetView()->GetPainter()->GetSettings(); + + if( rs ) + { + rs->SetHighlightFactor( aCfg->m_Graphics.highlight_factor ); + rs->SetSelectFactor( aCfg->m_Graphics.select_factor ); + rs->SetHighContrastFactor( aCfg->m_Graphics.high_contrast_factor ); + } }