[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:
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user