Better defaults for brightness factors
Also store them in the JSON so they can be tweaked
This commit is contained in:
parent
8bca145b75
commit
eb9756840d
|
@ -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<float>(
|
||||
"graphics.highlight_factor", &m_Graphics.highlight_factor, 0.5f, 0.0, 1.0f ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<float>(
|
||||
"graphics.select_factor", &m_Graphics.select_factor, 0.75f, 0.0, 1.0f ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<float>(
|
||||
"graphics.high_contrast_factor", &m_Graphics.high_contrast_factor, 0.35f, 0.0, 1.0f ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "color_picker.default_tab",
|
||||
&m_ColorPicker.default_tab, 0 ) );
|
||||
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue