[Gui] preferences: add button to switch gradient colors

- when finding a suitable background color gradient, it is annoying that there is no button to switch the begin/end color of the gradient. With the button one can quickly see the the changes and find a suitable gradient much quicker
This commit is contained in:
Uwe
2022-07-10 02:22:23 +02:00
parent 10301e7f75
commit fcd5394864
3 changed files with 57 additions and 55 deletions

View File

@@ -22,6 +22,10 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <QPushButton>
#endif
#include "DlgSettingsViewColor.h"
#include "ui_DlgSettingsViewColor.h"
@@ -41,6 +45,7 @@ DlgSettingsViewColor::DlgSettingsViewColor(QWidget* parent)
ui->setupUi(this);
ui->HighlightColor->setEnabled(ui->checkBoxPreselection->isChecked());
ui->SelectionColor->setEnabled(ui->checkBoxSelection->isChecked());
connect(ui->SwitchGradientColors, &QPushButton::pressed, this, &DlgSettingsViewColor::onSwitchGradientColorsPressed);
}
/**
@@ -98,5 +103,12 @@ void DlgSettingsViewColor::changeEvent(QEvent *e)
}
}
void DlgSettingsViewColor::onSwitchGradientColorsPressed()
{
QColor tempColor = ui->backgroundColorFrom->color();
ui->backgroundColorFrom->setColor(ui->backgroundColorTo->color());
ui->backgroundColorTo->setColor(tempColor);
}
#include "moc_DlgSettingsViewColor.cpp"