| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| | #include <QPushButton>
|
| |
|
| |
|
| | #include "DlgSettingsViewColor.h"
|
| | #include "ui_DlgSettingsViewColor.h"
|
| |
|
| |
|
| | using namespace Gui::Dialog;
|
| |
|
| |
|
| |
|
| | |
| | |
| | |
| |
|
| | DlgSettingsViewColor::DlgSettingsViewColor(QWidget* parent)
|
| | : PreferencePage(parent)
|
| | , ui(new Ui_DlgSettingsViewColor)
|
| | {
|
| |
|
| | ui->setupUi(this);
|
| | connect(ui->SwitchGradientColors, &QPushButton::pressed, this,
|
| | &DlgSettingsViewColor::onSwitchGradientColorsPressed);
|
| |
|
| | connect(ui->radioButtonSimple, &QRadioButton::toggled, this,
|
| | &DlgSettingsViewColor::onRadioButtonSimpleToggled);
|
| |
|
| | connect(ui->radioButtonGradient, &QRadioButton::toggled, this,
|
| | &DlgSettingsViewColor::onRadioButtonGradientToggled);
|
| |
|
| | connect(ui->rbRadialGradient, &QRadioButton::toggled, this,
|
| | &DlgSettingsViewColor::onRadioButtonRadialGradientToggled);
|
| |
|
| | connect(ui->checkMidColor, &QCheckBox::toggled, this,
|
| | &DlgSettingsViewColor::onCheckMidColorToggled);
|
| |
|
| | }
|
| |
|
| | |
| | |
| |
|
| | DlgSettingsViewColor::~DlgSettingsViewColor() = default;
|
| |
|
| | void DlgSettingsViewColor::saveSettings()
|
| | {
|
| | ui->SelectionColor_Background->onSave();
|
| | ui->backgroundColorFrom->onSave();
|
| | ui->backgroundColorTo->onSave();
|
| | ui->backgroundColorMid->onSave();
|
| | ui->radioButtonSimple->onSave();
|
| | ui->radioButtonGradient->onSave();
|
| | ui->rbRadialGradient->onSave();
|
| | ui->checkMidColor->onSave();
|
| | ui->TreeEditColor->onSave();
|
| | ui->TreeActiveColor->onSave();
|
| | ui->CbLabelColor->onSave();
|
| | ui->CbLabelTextSize->onSave();
|
| | }
|
| |
|
| | void DlgSettingsViewColor::loadSettings()
|
| | {
|
| | ui->SelectionColor_Background->onRestore();
|
| | ui->backgroundColorFrom->onRestore();
|
| | ui->backgroundColorTo->onRestore();
|
| | ui->backgroundColorMid->onRestore();
|
| | ui->radioButtonSimple->onRestore();
|
| | ui->radioButtonGradient->onRestore();
|
| | ui->rbRadialGradient->onRestore();
|
| | ui->checkMidColor->onRestore();
|
| | ui->TreeEditColor->onRestore();
|
| | ui->TreeActiveColor->onRestore();
|
| | ui->CbLabelColor->onRestore();
|
| | ui->CbLabelTextSize->onRestore();
|
| |
|
| | if (ui->radioButtonSimple->isChecked()) {
|
| | onRadioButtonSimpleToggled(true);
|
| | }
|
| | else if (ui->radioButtonGradient->isChecked()) {
|
| | onRadioButtonGradientToggled(true);
|
| | }
|
| | else {
|
| | onRadioButtonRadialGradientToggled(true);
|
| | }
|
| | }
|
| |
|
| | |
| | |
| |
|
| | void DlgSettingsViewColor::changeEvent(QEvent* e)
|
| | {
|
| | if (e->type() == QEvent::LanguageChange) {
|
| | ui->retranslateUi(this);
|
| | }
|
| | else {
|
| | QWidget::changeEvent(e);
|
| | }
|
| | }
|
| |
|
| | void DlgSettingsViewColor::onSwitchGradientColorsPressed()
|
| | {
|
| | QColor tempColor = ui->backgroundColorFrom->color();
|
| | ui->backgroundColorFrom->setColor(ui->backgroundColorTo->color());
|
| | ui->backgroundColorTo->setColor(tempColor);
|
| | }
|
| |
|
| | void DlgSettingsViewColor::onCheckMidColorToggled(bool val)
|
| | {
|
| | ui->color2Label->setEnabled(val);
|
| | ui->backgroundColorMid->setEnabled(val);
|
| | }
|
| |
|
| | void DlgSettingsViewColor::onRadioButtonSimpleToggled(bool val)
|
| | {
|
| | setGradientColorVisibility(!val);
|
| | }
|
| |
|
| | void DlgSettingsViewColor::onRadioButtonGradientToggled(bool val)
|
| | {
|
| | setGradientColorVisibility(val);
|
| | ui->color1Label->setText(tr("Top:"));
|
| | ui->color2Label->setText(tr("Middle:"));
|
| | ui->color3Label->setText(tr("Bottom:"));
|
| | }
|
| |
|
| | void DlgSettingsViewColor::onRadioButtonRadialGradientToggled(bool val)
|
| | {
|
| | setGradientColorVisibility(val);
|
| | ui->color1Label->setText(tr("Central:"));
|
| | ui->color2Label->setText(tr("Midway:"));
|
| | ui->color3Label->setText(tr("End:"));
|
| | }
|
| |
|
| | void DlgSettingsViewColor::setGradientColorVisibility(bool val)
|
| | {
|
| | ui->SelectionColor_Background->setVisible(!val);
|
| | ui->color1Label->setVisible(val);
|
| | ui->backgroundColorFrom->setVisible(val);
|
| | ui->color2Label->setVisible(val);
|
| | ui->backgroundColorMid->setVisible(val);
|
| | ui->color3Label->setVisible(val);
|
| | ui->backgroundColorTo->setVisible(val);
|
| | ui->checkMidColor->setVisible(val);
|
| | ui->SwitchGradientColors->setVisible(val);
|
| |
|
| | if (val) {
|
| | onCheckMidColorToggled(ui->checkMidColor->isChecked());
|
| | }
|
| | }
|
| |
|
| | #include "moc_DlgSettingsViewColor.cpp"
|
| |
|