2021-01-24 12:53:02 +01:00
|
|
|
#include "lc_edgecolordialog.h"
|
|
|
|
#include "lc_application.h"
|
|
|
|
|
2021-01-25 13:35:04 +01:00
|
|
|
lcAutomateEdgeColorDialog::lcAutomateEdgeColorDialog(QWidget* Parent, bool ShowHighContrastDialog)
|
2021-01-24 12:53:02 +01:00
|
|
|
:QDialog(Parent)
|
|
|
|
{
|
2021-01-26 18:38:34 +01:00
|
|
|
const lcPreferences& Preferences = lcGetPreferences();
|
2023-04-17 18:37:56 +02:00
|
|
|
mStudCylinderColorEnabled = Preferences.mStudCylinderColorEnabled;
|
2021-01-26 18:38:34 +01:00
|
|
|
mStudCylinderColor = Preferences.mStudCylinderColor;
|
2023-04-17 18:37:56 +02:00
|
|
|
mPartEdgeColorEnabled = Preferences.mPartEdgeColorEnabled;
|
2021-01-26 18:38:34 +01:00
|
|
|
mPartEdgeColor = Preferences.mPartEdgeColor;
|
2023-04-17 18:37:56 +02:00
|
|
|
mBlackEdgeColorEnabled = Preferences.mBlackEdgeColorEnabled;
|
2021-01-26 18:38:34 +01:00
|
|
|
mBlackEdgeColor = Preferences.mBlackEdgeColor;
|
2023-04-17 18:37:56 +02:00
|
|
|
mDarkEdgeColorEnabled = Preferences.mDarkEdgeColorEnabled;
|
2021-01-26 18:38:34 +01:00
|
|
|
mDarkEdgeColor = Preferences.mDarkEdgeColor;
|
|
|
|
mPartEdgeContrast = Preferences.mPartEdgeContrast;
|
|
|
|
mPartColorValueLDIndex = Preferences.mPartColorValueLDIndex;
|
2021-01-24 12:53:02 +01:00
|
|
|
|
2021-01-25 08:34:22 +01:00
|
|
|
setWindowTitle(tr("Color Preferences"));
|
|
|
|
QVBoxLayout* MainLayout = new QVBoxLayout(this);
|
2021-01-24 12:53:02 +01:00
|
|
|
|
2021-01-25 08:34:22 +01:00
|
|
|
QGroupBox* EdgeSettingsBox = new QGroupBox(tr("Edge Colors"), this);
|
|
|
|
MainLayout->addWidget(EdgeSettingsBox);
|
2021-01-24 12:53:02 +01:00
|
|
|
QGridLayout* EdgeSettingsLayout = new QGridLayout(EdgeSettingsBox);
|
|
|
|
EdgeSettingsBox->setLayout(EdgeSettingsLayout);
|
|
|
|
|
2021-01-26 18:38:34 +01:00
|
|
|
int LDIndexRow = 0;
|
|
|
|
PartEdgeContrast = nullptr;
|
|
|
|
PartEdgeContrastSlider = nullptr;
|
|
|
|
if (!ShowHighContrastDialog)
|
|
|
|
{
|
|
|
|
LDIndexRow = 1;
|
|
|
|
QLabel* PartEdgeContrastLabel = new QLabel(tr("Contrast:"), this);
|
|
|
|
PartEdgeContrast = new QLabel(this);
|
|
|
|
PartEdgeContrastSlider = new QSlider(Qt::Horizontal, this);
|
|
|
|
PartEdgeContrastSlider->setRange(0, 100);
|
|
|
|
PartEdgeContrastSlider->setValue(mPartEdgeContrast * 100);
|
|
|
|
PartEdgeContrastSlider->setToolTip(tr("Set the amount of contrast - 0.50 is midway."));
|
|
|
|
connect(PartEdgeContrastSlider, SIGNAL(valueChanged(int)), this, SLOT(SliderValueChanged(int)));
|
|
|
|
emit PartEdgeContrastSlider->valueChanged(PartEdgeContrastSlider->value());
|
2021-01-24 12:53:02 +01:00
|
|
|
|
2021-01-26 18:38:34 +01:00
|
|
|
ResetPartEdgeContrastButton = new QToolButton(this);
|
|
|
|
ResetPartEdgeContrastButton->setText(tr("Reset"));
|
|
|
|
connect(ResetPartEdgeContrastButton, SIGNAL(clicked()), this, SLOT(ResetSliderButtonClicked()));
|
2021-01-25 21:43:26 +01:00
|
|
|
|
2021-01-26 18:38:34 +01:00
|
|
|
EdgeSettingsLayout->addWidget(PartEdgeContrastLabel,0,0);
|
|
|
|
EdgeSettingsLayout->addWidget(PartEdgeContrastSlider,0,1);
|
|
|
|
EdgeSettingsLayout->addWidget(PartEdgeContrast,0,2);
|
|
|
|
EdgeSettingsLayout->addWidget(ResetPartEdgeContrastButton,0,3);
|
|
|
|
}
|
2021-01-24 12:53:02 +01:00
|
|
|
|
2022-05-16 21:36:52 +02:00
|
|
|
QLabel* PartColorValueLDIndexLabel = new QLabel(ShowHighContrastDialog ? tr("Light/Dark Value:") : tr("Saturation:"), this);
|
2021-01-25 08:34:22 +01:00
|
|
|
PartColorValueLDIndex = new QLabel(this);
|
|
|
|
PartColorValueLDIndexSlider = new QSlider(Qt::Horizontal, this);
|
|
|
|
PartColorValueLDIndexSlider->setRange(0, 100);
|
|
|
|
PartColorValueLDIndexSlider->setValue(mPartColorValueLDIndex * 100);
|
2022-05-16 21:36:52 +02:00
|
|
|
PartColorValueLDIndexSlider->setToolTip(ShowHighContrastDialog ?
|
|
|
|
tr("Set to classify where color values are light or dark - e.g. Dark Bluish Gray (72) is light at 0.39.") :
|
|
|
|
tr("Set to specify amount of edge color tint or shade from the saturation adjusted part color"));
|
2021-01-25 08:34:22 +01:00
|
|
|
connect(PartColorValueLDIndexSlider, SIGNAL(valueChanged(int)), this, SLOT(SliderValueChanged(int)));
|
|
|
|
emit PartColorValueLDIndexSlider->valueChanged(PartColorValueLDIndexSlider->value());
|
|
|
|
|
2021-01-25 21:43:26 +01:00
|
|
|
ResetPartColorValueLDIndexButton = new QToolButton(this);
|
2021-01-26 16:42:19 +01:00
|
|
|
ResetPartColorValueLDIndexButton->setText(tr("Reset"));
|
2021-01-25 21:43:26 +01:00
|
|
|
connect(ResetPartColorValueLDIndexButton, SIGNAL(clicked()), this, SLOT(ResetSliderButtonClicked()));
|
|
|
|
|
2021-01-26 18:38:34 +01:00
|
|
|
EdgeSettingsLayout->addWidget(PartColorValueLDIndexLabel,LDIndexRow,0);
|
|
|
|
EdgeSettingsLayout->addWidget(PartColorValueLDIndexSlider,LDIndexRow,1);
|
|
|
|
EdgeSettingsLayout->addWidget(PartColorValueLDIndex,LDIndexRow,2);
|
|
|
|
EdgeSettingsLayout->addWidget(ResetPartColorValueLDIndexButton,LDIndexRow,3);
|
2021-01-25 08:34:22 +01:00
|
|
|
|
2021-01-26 16:42:19 +01:00
|
|
|
QGroupBox* HighContrastColorBox = new QGroupBox(tr("High Contrast"), this);
|
|
|
|
HighContrastColorBox->setVisible(ShowHighContrastDialog);
|
|
|
|
MainLayout->addWidget(HighContrastColorBox);
|
|
|
|
QGridLayout* HighContrastColorLayout = new QGridLayout(HighContrastColorBox);
|
|
|
|
HighContrastColorBox->setLayout(HighContrastColorLayout);
|
2021-01-24 12:53:02 +01:00
|
|
|
|
|
|
|
auto SetButtonPixmap = [](quint32 Color, QToolButton* Button)
|
|
|
|
{
|
|
|
|
QPixmap Pixmap(12, 12);
|
|
|
|
QColor ButtonColor(QColor(LC_RGBA_RED(Color), LC_RGBA_GREEN(Color), LC_RGBA_BLUE(Color)));
|
|
|
|
Pixmap.fill(ButtonColor);
|
|
|
|
Button->setIcon(Pixmap);
|
|
|
|
Button->setToolTip(ButtonColor.name().toUpper());
|
|
|
|
};
|
|
|
|
|
2023-04-17 18:37:56 +02:00
|
|
|
StudCylinderColorEnabledBox = new QCheckBox(tr("Stud Cylinder Color:"), this);
|
|
|
|
StudCylinderColorEnabledBox->setChecked(mStudCylinderColorEnabled);
|
|
|
|
connect(StudCylinderColorEnabledBox, SIGNAL(clicked()), this, SLOT(ColorCheckBoxClicked()));
|
|
|
|
|
2021-01-26 16:42:19 +01:00
|
|
|
StudCylinderColorButton = new QToolButton(this);
|
2023-04-17 18:37:56 +02:00
|
|
|
StudCylinderColorButton->setEnabled(mStudCylinderColorEnabled);
|
2021-01-26 16:42:19 +01:00
|
|
|
SetButtonPixmap(mStudCylinderColor, StudCylinderColorButton);
|
|
|
|
connect(StudCylinderColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked()));
|
2021-01-24 12:53:02 +01:00
|
|
|
|
2021-01-26 16:42:19 +01:00
|
|
|
ResetStudCylinderColorButton = new QToolButton(this);
|
2023-04-17 18:37:56 +02:00
|
|
|
ResetStudCylinderColorButton->setText(tr("Reset"));
|
|
|
|
ResetStudCylinderColorButton->setEnabled(mStudCylinderColorEnabled);
|
2021-01-26 16:42:19 +01:00
|
|
|
connect(ResetStudCylinderColorButton, SIGNAL(clicked()), this, SLOT(ResetColorButtonClicked()));
|
2021-01-24 12:53:02 +01:00
|
|
|
|
2023-04-17 18:37:56 +02:00
|
|
|
HighContrastColorLayout->addWidget(StudCylinderColorEnabledBox,0,0);
|
2021-01-26 16:42:19 +01:00
|
|
|
HighContrastColorLayout->addWidget(StudCylinderColorButton,0,1);
|
|
|
|
HighContrastColorLayout->addWidget(ResetStudCylinderColorButton,0,2);
|
2021-01-24 12:53:02 +01:00
|
|
|
|
2023-04-17 18:37:56 +02:00
|
|
|
PartEdgeColorEnabledBox = new QCheckBox(tr("Parts Edge Color:"), this);
|
|
|
|
PartEdgeColorEnabledBox->setChecked(mPartEdgeColorEnabled);
|
|
|
|
connect(PartEdgeColorEnabledBox, SIGNAL(clicked()), this, SLOT(ColorCheckBoxClicked()));
|
|
|
|
|
2021-01-26 16:42:19 +01:00
|
|
|
PartEdgeColorButton = new QToolButton(this);
|
2023-04-17 18:37:56 +02:00
|
|
|
PartEdgeColorButton->setEnabled(mPartEdgeColorEnabled);
|
2021-01-26 16:42:19 +01:00
|
|
|
SetButtonPixmap(mPartEdgeColor, PartEdgeColorButton);
|
|
|
|
connect(PartEdgeColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked()));
|
2021-01-24 12:53:02 +01:00
|
|
|
|
2021-01-26 16:42:19 +01:00
|
|
|
ResetPartEdgeColorButton = new QToolButton(this);
|
|
|
|
ResetPartEdgeColorButton->setText(tr("Reset"));
|
2023-04-17 18:37:56 +02:00
|
|
|
ResetPartEdgeColorButton->setEnabled(mPartEdgeColorEnabled);
|
2021-01-26 16:42:19 +01:00
|
|
|
connect(ResetPartEdgeColorButton, SIGNAL(clicked()), this, SLOT(ResetColorButtonClicked()));
|
2021-01-24 12:53:02 +01:00
|
|
|
|
2023-04-17 18:37:56 +02:00
|
|
|
HighContrastColorLayout->addWidget(PartEdgeColorEnabledBox,1,0);
|
2021-01-26 16:42:19 +01:00
|
|
|
HighContrastColorLayout->addWidget(PartEdgeColorButton,1,1);
|
|
|
|
HighContrastColorLayout->addWidget(ResetPartEdgeColorButton,1,2);
|
2021-01-24 12:53:02 +01:00
|
|
|
|
2023-04-19 14:30:05 +02:00
|
|
|
BlackEdgeColorEnabledBox = new QCheckBox(tr("Black Parts Edge Color:"), this);
|
2023-04-17 18:37:56 +02:00
|
|
|
BlackEdgeColorEnabledBox->setChecked(mBlackEdgeColorEnabled);
|
|
|
|
connect(BlackEdgeColorEnabledBox, SIGNAL(clicked()), this, SLOT(ColorCheckBoxClicked()));
|
|
|
|
|
2021-01-25 13:35:04 +01:00
|
|
|
BlackEdgeColorButton = new QToolButton(this);
|
2023-04-17 18:37:56 +02:00
|
|
|
BlackEdgeColorButton->setEnabled(mBlackEdgeColorEnabled);
|
2021-01-25 13:35:04 +01:00
|
|
|
SetButtonPixmap(mBlackEdgeColor, BlackEdgeColorButton);
|
|
|
|
connect(BlackEdgeColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked()));
|
|
|
|
|
|
|
|
ResetBlackEdgeColorButton = new QToolButton(this);
|
2021-01-26 16:42:19 +01:00
|
|
|
ResetBlackEdgeColorButton->setText(tr("Reset"));
|
2023-04-17 18:37:56 +02:00
|
|
|
ResetBlackEdgeColorButton->setEnabled(mBlackEdgeColorEnabled);
|
2021-01-25 13:35:04 +01:00
|
|
|
connect(ResetBlackEdgeColorButton, SIGNAL(clicked()), this, SLOT(ResetColorButtonClicked()));
|
|
|
|
|
2023-04-17 18:37:56 +02:00
|
|
|
HighContrastColorLayout->addWidget(BlackEdgeColorEnabledBox,2,0);
|
2021-01-26 16:42:19 +01:00
|
|
|
HighContrastColorLayout->addWidget(BlackEdgeColorButton,2,1);
|
|
|
|
HighContrastColorLayout->addWidget(ResetBlackEdgeColorButton,2,2);
|
2021-01-25 13:35:04 +01:00
|
|
|
|
2023-04-17 18:37:56 +02:00
|
|
|
DarkEdgeColorEnabledBox = new QCheckBox(tr("Dark Parts Edge Color:"), this);
|
|
|
|
DarkEdgeColorEnabledBox->setChecked(mDarkEdgeColorEnabled);
|
|
|
|
connect(DarkEdgeColorEnabledBox, SIGNAL(clicked()), this, SLOT(ColorCheckBoxClicked()));
|
|
|
|
|
2021-01-25 13:35:04 +01:00
|
|
|
DarkEdgeColorButton = new QToolButton(this);
|
2023-04-17 18:37:56 +02:00
|
|
|
DarkEdgeColorButton->setEnabled(mDarkEdgeColorEnabled);
|
2021-01-25 13:35:04 +01:00
|
|
|
SetButtonPixmap(mDarkEdgeColor, DarkEdgeColorButton);
|
|
|
|
connect(DarkEdgeColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked()));
|
|
|
|
|
|
|
|
ResetDarkEdgeColorButton = new QToolButton(this);
|
2021-01-26 16:42:19 +01:00
|
|
|
ResetDarkEdgeColorButton->setText(tr("Reset"));
|
2023-04-17 18:37:56 +02:00
|
|
|
ResetDarkEdgeColorButton->setEnabled(mDarkEdgeColorEnabled);
|
2021-01-25 13:35:04 +01:00
|
|
|
connect(ResetDarkEdgeColorButton, SIGNAL(clicked()), this, SLOT(ResetColorButtonClicked()));
|
|
|
|
|
2023-04-17 18:37:56 +02:00
|
|
|
HighContrastColorLayout->addWidget(DarkEdgeColorEnabledBox,3,0);
|
2021-01-26 16:42:19 +01:00
|
|
|
HighContrastColorLayout->addWidget(DarkEdgeColorButton,3,1);
|
|
|
|
HighContrastColorLayout->addWidget(ResetDarkEdgeColorButton,3,2);
|
2021-01-25 13:35:04 +01:00
|
|
|
|
2021-01-25 08:34:22 +01:00
|
|
|
QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
|
|
|
|
MainLayout->addWidget(buttonBox);
|
2021-01-24 12:53:02 +01:00
|
|
|
QObject::connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
|
|
|
QObject::connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
|
|
|
|
|
|
|
setMinimumSize(220,100);
|
|
|
|
}
|
|
|
|
|
2023-04-17 18:37:56 +02:00
|
|
|
void lcAutomateEdgeColorDialog::ColorCheckBoxClicked()
|
|
|
|
{
|
|
|
|
QObject* CheckBox = sender();
|
|
|
|
if (CheckBox == StudCylinderColorEnabledBox)
|
|
|
|
{
|
|
|
|
mStudCylinderColorEnabled = StudCylinderColorEnabledBox->isChecked();
|
|
|
|
StudCylinderColorButton->setEnabled(mStudCylinderColorEnabled);
|
|
|
|
ResetStudCylinderColorButton->setEnabled(mStudCylinderColorEnabled);
|
|
|
|
}
|
|
|
|
else if (CheckBox == PartEdgeColorEnabledBox)
|
|
|
|
{
|
|
|
|
mPartEdgeColorEnabled = PartEdgeColorEnabledBox->isChecked();
|
|
|
|
PartEdgeColorButton->setEnabled(mPartEdgeColorEnabled);
|
|
|
|
ResetPartEdgeColorButton->setEnabled(mPartEdgeColorEnabled);
|
|
|
|
}
|
|
|
|
else if (CheckBox == BlackEdgeColorEnabledBox)
|
|
|
|
{
|
|
|
|
mBlackEdgeColorEnabled = BlackEdgeColorEnabledBox->isChecked();
|
|
|
|
BlackEdgeColorButton->setEnabled(mBlackEdgeColorEnabled);
|
|
|
|
ResetBlackEdgeColorButton->setEnabled(mBlackEdgeColorEnabled);
|
|
|
|
}
|
|
|
|
else if (CheckBox == DarkEdgeColorEnabledBox)
|
|
|
|
{
|
|
|
|
mDarkEdgeColorEnabled = DarkEdgeColorEnabledBox->isChecked();
|
|
|
|
DarkEdgeColorButton->setEnabled(mDarkEdgeColorEnabled);
|
|
|
|
ResetDarkEdgeColorButton->setEnabled(mDarkEdgeColorEnabled);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-24 12:53:02 +01:00
|
|
|
void lcAutomateEdgeColorDialog::SliderValueChanged(int Value)
|
|
|
|
{
|
|
|
|
if (sender() == PartEdgeContrastSlider)
|
|
|
|
{
|
2021-01-25 08:34:22 +01:00
|
|
|
mPartEdgeContrast = Value * 0.01f;
|
|
|
|
PartEdgeContrast->setText(QString::number(mPartEdgeContrast, 'f', 2));
|
2021-01-24 12:53:02 +01:00
|
|
|
}
|
2021-01-25 08:34:22 +01:00
|
|
|
else if (sender() == PartColorValueLDIndexSlider)
|
2021-01-24 12:53:02 +01:00
|
|
|
{
|
2021-01-25 08:34:22 +01:00
|
|
|
mPartColorValueLDIndex = Value * 0.01f;
|
|
|
|
PartColorValueLDIndex->setText(QString::number(mPartColorValueLDIndex, 'f', 2));
|
2021-01-24 12:53:02 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void lcAutomateEdgeColorDialog::ColorButtonClicked()
|
|
|
|
{
|
|
|
|
QObject* Button = sender();
|
|
|
|
QString Title;
|
|
|
|
quint32* Color = nullptr;
|
|
|
|
QColorDialog::ColorDialogOptions DialogOptions;
|
|
|
|
|
2021-01-26 16:42:19 +01:00
|
|
|
if (Button == StudCylinderColorButton)
|
2021-01-24 12:53:02 +01:00
|
|
|
{
|
2021-01-26 16:42:19 +01:00
|
|
|
Title = tr("Select Stud Cylinder Color");
|
|
|
|
Color = &mStudCylinderColor;
|
2021-01-24 12:53:02 +01:00
|
|
|
}
|
2021-01-26 16:42:19 +01:00
|
|
|
else if (Button == PartEdgeColorButton)
|
2021-01-24 12:53:02 +01:00
|
|
|
{
|
2021-01-26 16:42:19 +01:00
|
|
|
Title = tr("Select Part Edge Color");
|
|
|
|
Color = &mPartEdgeColor;
|
2021-01-24 12:53:02 +01:00
|
|
|
}
|
2021-01-25 13:35:04 +01:00
|
|
|
else if (Button == BlackEdgeColorButton)
|
|
|
|
{
|
2021-01-25 22:16:44 +01:00
|
|
|
if (lcGetPreferences().mAutomateEdgeColor)
|
|
|
|
{
|
|
|
|
QMessageBox msgBox;
|
2022-05-16 21:36:52 +02:00
|
|
|
msgBox.setText(tr("Automate edge color appears to be enabled.<br>Black parts edge color will not be accessible.<br>Do you want to continue?"));
|
2021-01-25 22:16:44 +01:00
|
|
|
if (msgBox.exec() != QMessageBox::Accepted)
|
|
|
|
return;
|
|
|
|
}
|
2021-01-25 13:35:04 +01:00
|
|
|
Title = tr("Select Black Edge Color");
|
|
|
|
Color = &mBlackEdgeColor;
|
|
|
|
}
|
|
|
|
else if (Button == DarkEdgeColorButton)
|
|
|
|
{
|
2021-01-25 22:16:44 +01:00
|
|
|
if (lcGetPreferences().mAutomateEdgeColor)
|
|
|
|
{
|
|
|
|
QMessageBox msgBox;
|
2022-05-16 21:36:52 +02:00
|
|
|
msgBox.setText(tr("Automate edge color appears to be enabled.<br>Dark parts edge color will not be accessible.<br>Do you want to continue?"));
|
2021-01-25 22:16:44 +01:00
|
|
|
if (msgBox.exec() != QMessageBox::Accepted)
|
|
|
|
return;
|
|
|
|
}
|
2021-01-25 13:35:04 +01:00
|
|
|
Title = tr("Select Dark Edge Color");
|
|
|
|
Color = &mDarkEdgeColor;
|
|
|
|
}
|
2021-01-24 12:53:02 +01:00
|
|
|
else
|
|
|
|
return;
|
|
|
|
|
2021-01-25 08:34:22 +01:00
|
|
|
QColor OldColor = QColor(LC_RGBA_RED(*Color), LC_RGBA_GREEN(*Color), LC_RGBA_BLUE(*Color), LC_RGBA_ALPHA(*Color));
|
|
|
|
QColor NewColor = QColorDialog::getColor(OldColor, this, Title, DialogOptions);
|
2021-01-24 12:53:02 +01:00
|
|
|
|
2021-01-25 08:34:22 +01:00
|
|
|
if (NewColor == OldColor || !NewColor.isValid())
|
2021-01-24 12:53:02 +01:00
|
|
|
return;
|
|
|
|
|
|
|
|
*Color = LC_RGBA(NewColor.red(), NewColor.green(), NewColor.blue(), NewColor.alpha());
|
|
|
|
|
2021-01-25 08:34:22 +01:00
|
|
|
QPixmap Pix(12, 12);
|
2021-01-24 12:53:02 +01:00
|
|
|
NewColor.setAlpha(255);
|
2021-01-25 08:34:22 +01:00
|
|
|
Pix.fill(NewColor);
|
|
|
|
((QToolButton*)Button)->setIcon(Pix);
|
2021-01-24 12:53:02 +01:00
|
|
|
((QToolButton*)Button)->setToolTip(NewColor.name().toUpper());
|
|
|
|
}
|
|
|
|
|
2021-01-25 21:43:26 +01:00
|
|
|
void lcAutomateEdgeColorDialog::ResetSliderButtonClicked()
|
|
|
|
{
|
|
|
|
if (sender() == ResetPartEdgeContrastButton)
|
|
|
|
{
|
|
|
|
PartEdgeContrastSlider->setValue(0.5f * 100);
|
|
|
|
}
|
|
|
|
else if (sender() == ResetPartColorValueLDIndexButton)
|
|
|
|
{
|
|
|
|
PartColorValueLDIndexSlider->setValue(0.5f * 100);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-24 12:53:02 +01:00
|
|
|
void lcAutomateEdgeColorDialog::ResetColorButtonClicked()
|
|
|
|
{
|
|
|
|
quint32* Color = nullptr;
|
2021-01-25 08:34:22 +01:00
|
|
|
QPixmap Pix(12, 12);
|
2021-01-24 12:53:02 +01:00
|
|
|
QColor ResetColor;
|
|
|
|
|
2021-01-26 16:42:19 +01:00
|
|
|
if (sender() == ResetStudCylinderColorButton)
|
2021-01-24 12:53:02 +01:00
|
|
|
{
|
2021-01-26 16:42:19 +01:00
|
|
|
Color = &mStudCylinderColor;
|
2021-01-25 13:35:04 +01:00
|
|
|
*Color = LC_RGBA(27, 42, 52, 255);
|
2021-01-24 12:53:02 +01:00
|
|
|
ResetColor = QColor(LC_RGBA_RED(*Color), LC_RGBA_GREEN(*Color), LC_RGBA_BLUE(*Color), LC_RGBA_ALPHA(*Color));
|
2021-01-25 08:34:22 +01:00
|
|
|
Pix.fill(ResetColor);
|
2021-01-26 16:42:19 +01:00
|
|
|
StudCylinderColorButton->setIcon(Pix);
|
|
|
|
StudCylinderColorButton->setToolTip(ResetColor.name().toUpper());
|
2021-01-24 12:53:02 +01:00
|
|
|
}
|
2021-01-26 16:42:19 +01:00
|
|
|
else if (sender() == ResetPartEdgeColorButton)
|
2021-01-24 12:53:02 +01:00
|
|
|
{
|
2021-01-26 16:42:19 +01:00
|
|
|
Color = &mPartEdgeColor;
|
2021-01-25 13:35:04 +01:00
|
|
|
*Color = LC_RGBA(0, 0, 0, 255);
|
2021-01-24 12:53:02 +01:00
|
|
|
ResetColor = QColor(LC_RGBA_RED(*Color), LC_RGBA_GREEN(*Color), LC_RGBA_BLUE(*Color), LC_RGBA_ALPHA(*Color));
|
2021-01-25 08:34:22 +01:00
|
|
|
Pix.fill(ResetColor);
|
2021-01-26 16:42:19 +01:00
|
|
|
PartEdgeColorButton->setIcon(Pix);
|
|
|
|
PartEdgeColorButton->setToolTip(ResetColor.name().toUpper());
|
2021-01-24 12:53:02 +01:00
|
|
|
}
|
2021-01-25 21:18:43 +01:00
|
|
|
else if (sender() == ResetBlackEdgeColorButton)
|
2021-01-25 13:35:04 +01:00
|
|
|
{
|
|
|
|
Color = &mBlackEdgeColor;
|
2021-01-25 21:18:43 +01:00
|
|
|
*Color = LC_RGBA(255, 255, 255, 255);
|
2021-01-25 13:35:04 +01:00
|
|
|
ResetColor = QColor(LC_RGBA_RED(*Color), LC_RGBA_GREEN(*Color), LC_RGBA_BLUE(*Color), LC_RGBA_ALPHA(*Color));
|
|
|
|
Pix.fill(ResetColor);
|
|
|
|
BlackEdgeColorButton->setIcon(Pix);
|
|
|
|
BlackEdgeColorButton->setToolTip(ResetColor.name().toUpper());
|
|
|
|
}
|
2021-01-25 21:18:43 +01:00
|
|
|
else if (sender() == ResetDarkEdgeColorButton)
|
2021-01-25 13:35:04 +01:00
|
|
|
{
|
|
|
|
Color = &mDarkEdgeColor;
|
|
|
|
*Color = LC_RGBA(27, 42, 52, 255);
|
|
|
|
ResetColor = QColor(LC_RGBA_RED(*Color), LC_RGBA_GREEN(*Color), LC_RGBA_BLUE(*Color), LC_RGBA_ALPHA(*Color));
|
|
|
|
Pix.fill(ResetColor);
|
|
|
|
DarkEdgeColorButton->setIcon(Pix);
|
|
|
|
DarkEdgeColorButton->setToolTip(ResetColor.name().toUpper());
|
|
|
|
}
|
2021-01-24 12:53:02 +01:00
|
|
|
}
|