void FontSetupPage::initColorGroup()
{
    m_colorGroup = new QGroupBox(tr("Use Custom Color"), this);
    m_colorGroup->setCheckable(true);
    m_colorGroup->setChecked(INIMANAGER()->isEnableCustomColor());
    m_colorGroup->setGeometry(10, 150, 310, 110);
    connect(m_colorGroup, SIGNAL(clicked(bool)), this, SLOT(colorGroupChecked(bool)));
    m_customColorEnabled = INIMANAGER()->isEnableCustomColor();

    m_foregroudLabel = new QLabel(tr("Foreground"), m_colorGroup);
    m_foregroudLabel->setGeometry(10, 30, 84, 20);

    m_backgroudLabel = new QLabel(tr("Background"), m_colorGroup);
    m_backgroudLabel->setGeometry(152, 30, 84, 20);

    m_highlightLabel = new QLabel(tr("Highlight"), m_colorGroup);
    m_highlightLabel->setGeometry(10, 70, 84, 20);

    m_foregroudColorButton = new QPushButton(m_colorGroup);
    m_foregroudColorButton->setFlat(true);
    m_foregroudColorButton->setAutoFillBackground(true);
    m_foregroudColorButton->setGeometry(94, 24, 30, 30);
    changeButtonColor(m_foregroudColorButton, INIMANAGER()->foregroundColor());
    connect(m_foregroudColorButton, SIGNAL(clicked()), this, SLOT(openForegroundColorDialog()));

    m_backgroudColorButton = new QPushButton(m_colorGroup);
    m_backgroudColorButton->setFlat(true);
    m_backgroudColorButton->setAutoFillBackground(true);
    m_backgroudColorButton->setGeometry(236, 24, 30, 30);
    changeButtonColor(m_backgroudColorButton, INIMANAGER()->backgroundColor());
    connect(m_backgroudColorButton, SIGNAL(clicked()), this, SLOT(openBackgroundColorDialog()));

    m_customBackgroudColorButton = new QPushButton(m_colorGroup);
    m_customBackgroudColorButton->setFlat(true);
    m_customBackgroudColorButton->setAutoFillBackground(true);
    m_customBackgroudColorButton->setGeometry(272, 24, 30, 30);
    changeButtonColor(m_customBackgroudColorButton, INIMANAGER()->customBackgroundColor());
    connect(m_customBackgroudColorButton, SIGNAL(clicked()), this, SLOT(openCustomBackgroundColorDialog()));

    m_currentLineFgColorButton = new QPushButton(m_colorGroup);
    m_currentLineFgColorButton->setFlat(true);
    m_currentLineFgColorButton->setAutoFillBackground(true);
    m_currentLineFgColorButton->setGeometry(94, 64, 30, 30);
    changeButtonColor(m_currentLineFgColorButton, INIMANAGER()->currentLineFgColor());
    connect(m_currentLineFgColorButton, SIGNAL(clicked()), this, SLOT(openCurrentLineFgColorDialog()));

    m_currentLineBgColorButton = new QPushButton(m_colorGroup);
    m_currentLineBgColorButton->setFlat(true);
    m_currentLineBgColorButton->setAutoFillBackground(true);
    m_currentLineBgColorButton->setGeometry(129, 64, 30, 30);
    changeButtonColor(m_currentLineBgColorButton, INIMANAGER()->currentLineBgColor());
    connect(m_currentLineBgColorButton, SIGNAL(clicked()), this, SLOT(openCurrentLineBgColorDialog()));

    m_foregroudColor = INIMANAGER()->foregroundColor();
    m_backgroudColor = INIMANAGER()->backgroundColor();
    m_customBackgroudColor = INIMANAGER()->customBackgroundColor();
    m_currentLineFgColor = INIMANAGER()->currentLineFgColor();
    m_currentLineBgColor = INIMANAGER()->currentLineBgColor();
}
void ReflectanceModelDockWidget::initializeColorButton()
{
    colorPushButton_ = new QPushButton(ui_->parameterWidget);
    colorPushButton_->setAutoFillBackground(true);
    colorPushButton_->setFlat(false);
    colorPushButton_->setMaximumWidth(40);
    qt_osg_util::setBackgroundColor(colorPushButton_, QColor(Qt::white));

    ui_->parameterFormLayout->addRow("Color:", colorPushButton_);

    connect(colorPushButton_, SIGNAL(clicked()), this, SLOT(changeButtonColor()));
}
void FontSetupPage::currentLineBgColorChanged(const QColor &color)
{
    static_cast<LogViewer*>(m_plainTextEdit)->setCurrentLineBgColor(color);
    changeButtonColor(m_currentLineBgColorButton, color);
    m_currentLineBgColor = color;
}
void FontSetupPage::customBackgroudColorChanged(const QColor &color)
{
    static_cast<LogViewer*>(m_plainTextEdit)->setCustomBackgroundColor(color);
    changeButtonColor(m_customBackgroudColorButton, color);
    m_customBackgroudColor = color;
}