Global colours are now enum values rather than global QColor objects

This commit is contained in:
Joel Holdsworth 2014-04-12 17:32:34 +01:00
parent d6e1295740
commit a87724b648
5 changed files with 25 additions and 16 deletions

View File

@ -310,7 +310,8 @@ ConfigDlg::cancelSLOT()
{
QString color;
color.sprintf( "color_%d", i );
QColorDialog::setCustomColor( i, m_cfg->getRGB( "Custom colors", color, Qt::white.rgb() ) );
QColorDialog::setCustomColor( i, m_cfg->getRGB( "Custom colors", color,
QColor(Qt::white).rgb() ) );
}
for (int i=0; i<NumItems; ++i)

View File

@ -45,8 +45,8 @@ void
DisplayPrefs::defaultsSLOT()
{
ui_bgColorDisplay->setColor( QColor( m_cfg->getRGB( "Display", "display-background", QColor( 212,220,207 ).rgb() )));
ui_textColor->setColor( QColor( m_cfg->getRGB( "Display", "display-text", Qt::black.rgb() )));
ui_textColor->setColor( QColor( m_cfg->getRGB( "Display", "display-text", QColor(Qt::black).rgb() )));
ui_showBar->setChecked( m_cfg->getBool( "Display", "display-bar", true ));
ui_showMinMax->setChecked( m_cfg->getBool( "Display", "display-min-max", true ));
}

View File

@ -46,19 +46,24 @@ GraphPrefs::~GraphPrefs()
void
GraphPrefs::defaultsSLOT()
{
ui_bgColor->setColor( QColor( m_cfg->getRGB( "Graph", "background", Qt::white.rgb() )));
ui_gridColor->setColor( QColor( m_cfg->getRGB( "Graph", "grid", Qt::gray.rgb() )));
ui_dataColor->setColor( QColor( m_cfg->getRGB( "Graph", "data", Qt::blue.rgb() )));
ui_cursorColor->setColor( QColor( m_cfg->getRGB( "Graph", "cursor", Qt::black.rgb() )));
ui_startColor->setColor( QColor( m_cfg->getRGB( "Graph", "start-trigger", Qt::magenta.rgb() )));
ui_extColor->setColor( QColor( m_cfg->getRGB( "Graph", "external-trigger", Qt::cyan.rgb() )));
ui_bgColor->setColor( QColor( m_cfg->getRGB( "Graph", "background",
QColor(Qt::white).rgb() )));
ui_gridColor->setColor( QColor( m_cfg->getRGB( "Graph", "grid",
QColor(Qt::gray).rgb() )));
ui_dataColor->setColor( QColor( m_cfg->getRGB( "Graph", "data",
QColor(Qt::blue).rgb() )));
ui_cursorColor->setColor( QColor( m_cfg->getRGB( "Graph", "cursor",
QColor(Qt::black).rgb() )));
ui_startColor->setColor( QColor( m_cfg->getRGB( "Graph", "start-trigger",
QColor(Qt::magenta).rgb() )));
ui_extColor->setColor( QColor( m_cfg->getRGB( "Graph", "external-trigger",
QColor(Qt::cyan).rgb() )));
ui_lineMode->setCurrentItem( m_cfg->getInt( "Graph", "line-mode", 1 ));
ui_pointMode->setCurrentItem( m_cfg->getInt( "Graph", "point-mode", 0 ));
ui_crosshair->setChecked( m_cfg->getBool( "Graph", "crosshair-cursor", true ));
ui_lineWidth->setValue( m_cfg->getInt( "Graph", "line-width", 2 ) );
}
void
@ -68,8 +73,8 @@ GraphPrefs::factoryDefaultsSLOT()
ui_gridColor->setColor( Qt::gray );
ui_dataColor->setColor( Qt::blue );
ui_cursorColor->setColor( Qt::black );
ui_startColor->setColor( Qt::magenta.rgb() );
ui_extColor->setColor( Qt::cyan.rgb() );
ui_startColor->setColor( QColor(Qt::magenta).rgb() );
ui_extColor->setColor( QColor(Qt::cyan).rgb() );
ui_lineMode->setCurrentItem( 1 );
ui_pointMode->setCurrentItem( 0 );
ui_lineWidth->setValue( 2 );

View File

@ -52,7 +52,8 @@ GuiPrefs::defaultsSLOT()
ui_showDisplay->setChecked( m_cfg->getBool( "Display", "show", true ));
ui_bgColorDisplay->setColor( QColor( m_cfg->getRGB( "Display", "display-background", QColor( 212,220,207 ).rgb() )));
ui_textColor->setColor( QColor( m_cfg->getRGB( "Display", "display-text", Qt::black.rgb() )));
ui_textColor->setColor( QColor( m_cfg->getRGB( "Display", "display-text",
QColor(Qt::black).rgb() )));
ui_showBar->setChecked( m_cfg->getBool( "Display", "display-bar", true ));
ui_showMinMax->setChecked( m_cfg->getBool( "Display", "display-min-max", true ));

View File

@ -54,8 +54,10 @@ IntegrationPrefs::~IntegrationPrefs()
void
IntegrationPrefs::defaultsSLOT()
{
ui_intColor->setColor( QColor( m_cfg->getRGB( "Graph", "integration", Qt::darkBlue.rgb() )));
ui_intThresholdColor->setColor( QColor( m_cfg->getRGB( "Graph", "integration-threshold", Qt::darkBlue.rgb() )));
ui_intColor->setColor( QColor( m_cfg->getRGB( "Graph", "integration",
QColor(Qt::darkBlue).rgb() )));
ui_intThresholdColor->setColor( QColor( m_cfg->getRGB( "Graph",
"integration-threshold", QColor(Qt::darkBlue).rgb() )));
ui_intLineMode->setCurrentItem( m_cfg->getInt( "Graph", "int-line-mode", 0 ));
ui_intPointMode->setCurrentItem( m_cfg->getInt( "Graph", "int-point-mode", 1 ));
ui_showInt->setChecked( m_cfg->getBool( "Graph", "show-integration", false ));
@ -69,7 +71,7 @@ void
IntegrationPrefs::factoryDefaultsSLOT()
{
ui_intColor->setColor( Qt::darkBlue );
ui_intThresholdColor->setColor( Qt::darkBlue.rgb() );
ui_intThresholdColor->setColor( QColor(Qt::darkBlue).rgb() );
ui_intLineMode->setCurrentItem( 0 );
ui_intPointMode->setCurrentItem( 1 );
ui_intLineWidth->setValue( 1 );