mirror of
https://github.com/leozide/leocad
synced 2025-01-30 20:34:56 +01:00
Make high contrast colours configurable and split preferences dialogue
This commit is contained in:
parent
512785de36
commit
feeb034ff9
10 changed files with 150 additions and 41 deletions
|
@ -60,6 +60,8 @@ void lcPreferences::LoadDefaults()
|
||||||
mDrawPreviewAxis = lcGetProfileInt(LC_PROFILE_PREVIEW_DRAW_AXES);
|
mDrawPreviewAxis = lcGetProfileInt(LC_PROFILE_PREVIEW_DRAW_AXES);
|
||||||
mStudColor = lcGetProfileInt(LC_PROFILE_STUD_COLOR);
|
mStudColor = lcGetProfileInt(LC_PROFILE_STUD_COLOR);
|
||||||
mStudEdgeColor = lcGetProfileInt(LC_PROFILE_STUD_EDGE_COLOR);
|
mStudEdgeColor = lcGetProfileInt(LC_PROFILE_STUD_EDGE_COLOR);
|
||||||
|
mBlackEdgeColor = lcGetProfileInt(LC_PROFILE_BLACK_EDGE_COLOR);
|
||||||
|
mDarkEdgeColor = lcGetProfileInt(LC_PROFILE_DARK_EDGE_COLOR);
|
||||||
mPartEdgeContrast = lcGetProfileFloat(LC_PROFILE_PART_EDGE_CONTRAST);
|
mPartEdgeContrast = lcGetProfileFloat(LC_PROFILE_PART_EDGE_CONTRAST);
|
||||||
mPartEdgeGamma = lcGetProfileFloat(LC_PROFILE_PART_EDGE_GAMMA);
|
mPartEdgeGamma = lcGetProfileFloat(LC_PROFILE_PART_EDGE_GAMMA);
|
||||||
mPartColorValueLDIndex = lcGetProfileFloat(LC_PROFILE_PART_COLOR_VALUE_LD_INDEX);
|
mPartColorValueLDIndex = lcGetProfileFloat(LC_PROFILE_PART_COLOR_VALUE_LD_INDEX);
|
||||||
|
@ -111,6 +113,8 @@ void lcPreferences::SaveDefaults()
|
||||||
lcSetProfileInt(LC_PROFILE_PREVIEW_DRAW_AXES, mDrawPreviewAxis);
|
lcSetProfileInt(LC_PROFILE_PREVIEW_DRAW_AXES, mDrawPreviewAxis);
|
||||||
lcSetProfileInt(LC_PROFILE_STUD_COLOR, mStudColor);
|
lcSetProfileInt(LC_PROFILE_STUD_COLOR, mStudColor);
|
||||||
lcSetProfileInt(LC_PROFILE_STUD_EDGE_COLOR, mStudEdgeColor);
|
lcSetProfileInt(LC_PROFILE_STUD_EDGE_COLOR, mStudEdgeColor);
|
||||||
|
lcSetProfileInt(LC_PROFILE_BLACK_EDGE_COLOR, mBlackEdgeColor);
|
||||||
|
lcSetProfileInt(LC_PROFILE_DARK_EDGE_COLOR, mDarkEdgeColor);
|
||||||
lcSetProfileFloat(LC_PROFILE_PART_EDGE_CONTRAST, mPartEdgeContrast);
|
lcSetProfileFloat(LC_PROFILE_PART_EDGE_CONTRAST, mPartEdgeContrast);
|
||||||
lcSetProfileFloat(LC_PROFILE_PART_EDGE_GAMMA, mPartEdgeGamma);
|
lcSetProfileFloat(LC_PROFILE_PART_EDGE_GAMMA, mPartEdgeGamma);
|
||||||
lcSetProfileFloat(LC_PROFILE_PART_COLOR_VALUE_LD_INDEX, mPartColorValueLDIndex);
|
lcSetProfileFloat(LC_PROFILE_PART_COLOR_VALUE_LD_INDEX, mPartColorValueLDIndex);
|
||||||
|
@ -1161,11 +1165,14 @@ void lcApplication::ShowPreferencesDialog()
|
||||||
bool AutomateEdgeColorChanged = Options.Preferences.mAutomateEdgeColor != bool(lcGetProfileInt(LC_PROFILE_AUTOMATE_EDGE_COLOR));
|
bool AutomateEdgeColorChanged = Options.Preferences.mAutomateEdgeColor != bool(lcGetProfileInt(LC_PROFILE_AUTOMATE_EDGE_COLOR));
|
||||||
bool StudColorChanged = Options.Preferences.mStudColor != quint32(lcGetProfileInt(LC_PROFILE_STUD_COLOR));
|
bool StudColorChanged = Options.Preferences.mStudColor != quint32(lcGetProfileInt(LC_PROFILE_STUD_COLOR));
|
||||||
bool StudEdgeColorChanged = Options.Preferences.mStudEdgeColor != quint32(lcGetProfileInt(LC_PROFILE_STUD_EDGE_COLOR));
|
bool StudEdgeColorChanged = Options.Preferences.mStudEdgeColor != quint32(lcGetProfileInt(LC_PROFILE_STUD_EDGE_COLOR));
|
||||||
|
bool BlackEdgeColorChanged = Options.Preferences.mBlackEdgeColor != quint32(lcGetProfileInt(LC_PROFILE_BLACK_EDGE_COLOR));
|
||||||
|
bool DarkEdgeColorChanged = Options.Preferences.mDarkEdgeColor != quint32(lcGetProfileInt(LC_PROFILE_DARK_EDGE_COLOR));
|
||||||
bool PartEdgeContrastChanged = Options.Preferences.mPartEdgeContrast != lcGetProfileFloat(LC_PROFILE_PART_EDGE_CONTRAST);
|
bool PartEdgeContrastChanged = Options.Preferences.mPartEdgeContrast != lcGetProfileFloat(LC_PROFILE_PART_EDGE_CONTRAST);
|
||||||
bool PartEdgeGammaChanged = Options.Preferences.mPartEdgeGamma != lcGetProfileFloat(LC_PROFILE_PART_EDGE_GAMMA);
|
bool PartEdgeGammaChanged = Options.Preferences.mPartEdgeGamma != lcGetProfileFloat(LC_PROFILE_PART_EDGE_GAMMA);
|
||||||
bool PartColorValueLDIndexChanged = Options.Preferences.mPartColorValueLDIndex != lcGetProfileFloat(LC_PROFILE_PART_COLOR_VALUE_LD_INDEX);
|
bool PartColorValueLDIndexChanged = Options.Preferences.mPartColorValueLDIndex != lcGetProfileFloat(LC_PROFILE_PART_COLOR_VALUE_LD_INDEX);
|
||||||
|
|
||||||
if (!AutomateEdgeColorChanged)
|
if (!AutomateEdgeColorChanged)
|
||||||
AutomateEdgeColorChanged = (StudColorChanged || StudEdgeColorChanged || PartEdgeContrastChanged || PartEdgeGammaChanged || PartColorValueLDIndexChanged);
|
AutomateEdgeColorChanged = (StudColorChanged || StudEdgeColorChanged || BlackEdgeColorChanged || DarkEdgeColorChanged || PartEdgeContrastChanged || PartEdgeGammaChanged || PartColorValueLDIndexChanged);
|
||||||
|
|
||||||
mPreferences = Options.Preferences;
|
mPreferences = Options.Preferences;
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,8 @@ public:
|
||||||
|
|
||||||
quint32 mStudColor;
|
quint32 mStudColor;
|
||||||
quint32 mStudEdgeColor;
|
quint32 mStudEdgeColor;
|
||||||
|
quint32 mBlackEdgeColor;
|
||||||
|
quint32 mDarkEdgeColor;
|
||||||
float mPartEdgeContrast;
|
float mPartEdgeContrast;
|
||||||
float mPartEdgeGamma;
|
float mPartEdgeGamma;
|
||||||
float mPartColorValueLDIndex;
|
float mPartColorValueLDIndex;
|
||||||
|
|
|
@ -240,17 +240,28 @@ static void lcAdjustStudStyleColors(std::vector<lcColor>& Colors, lcStudStyle St
|
||||||
else if (StudStyle != lcStudStyle::HighContrast && StudStyle != lcStudStyle::HighContrastLogo)
|
else if (StudStyle != lcStudStyle::HighContrast && StudStyle != lcStudStyle::HighContrastLogo)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
const lcVector4 Edge(LC_RGBA_RED(lcGetPreferences().mStudEdgeColor),
|
||||||
|
LC_RGBA_GREEN(lcGetPreferences().mStudEdgeColor),
|
||||||
|
LC_RGBA_BLUE(lcGetPreferences().mStudEdgeColor),
|
||||||
|
LC_RGBA_ALPHA(lcGetPreferences().mStudEdgeColor));
|
||||||
|
const lcVector4 DarkEdge(LC_RGBA_RED(lcGetPreferences().mDarkEdgeColor),
|
||||||
|
LC_RGBA_GREEN(lcGetPreferences().mDarkEdgeColor),
|
||||||
|
LC_RGBA_BLUE(lcGetPreferences().mDarkEdgeColor),
|
||||||
|
LC_RGBA_ALPHA(lcGetPreferences().mDarkEdgeColor));
|
||||||
|
const lcVector4 BlackEdge(LC_RGBA_RED(lcGetPreferences().mBlackEdgeColor),
|
||||||
|
LC_RGBA_GREEN(lcGetPreferences().mBlackEdgeColor),
|
||||||
|
LC_RGBA_BLUE(lcGetPreferences().mBlackEdgeColor),
|
||||||
|
LC_RGBA_ALPHA(lcGetPreferences().mBlackEdgeColor));
|
||||||
|
|
||||||
for (lcColor& Color : Colors)
|
for (lcColor& Color : Colors)
|
||||||
{
|
{
|
||||||
const lcVector4 FillColor = Color.Value * 255.0f;
|
const lcVector4 FillColor = Color.Value * 255.0f;
|
||||||
lcVector4 EdgeColor(0.0f, 0.0f, 0.0f, 255.0f);
|
|
||||||
|
|
||||||
if (30.0f * FillColor[0] + 59.0f * FillColor[1] + 11.0f * FillColor[2] <= 3600.0f)
|
if (30.0f * FillColor[0] + 59.0f * FillColor[1] + 11.0f * FillColor[2] <= 3600.0f)
|
||||||
EdgeColor = lcVector4(27.0f, 42.0f, 52.0f, 255.0f);
|
Color.Edge = DarkEdge / 255.0f;
|
||||||
else if (Color.Code == 0)
|
else if (Color.Code == 0)
|
||||||
EdgeColor = lcVector4(255.0f, 255.0f, 255.0f, 255.0f);
|
Color.Edge = BlackEdge / 255.0f;
|
||||||
|
else
|
||||||
Color.Edge = EdgeColor / 255.0f;
|
Color.Edge = Edge / 255.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,14 @@
|
||||||
|
|
||||||
#define MIN_GAMMA 1.0f
|
#define MIN_GAMMA 1.0f
|
||||||
|
|
||||||
lcAutomateEdgeColorDialog::lcAutomateEdgeColorDialog(QWidget* Parent)
|
lcAutomateEdgeColorDialog::lcAutomateEdgeColorDialog(QWidget* Parent, bool ShowHighContrastDialog)
|
||||||
:QDialog(Parent)
|
:QDialog(Parent)
|
||||||
{
|
{
|
||||||
mStudColor = lcGetPreferences().mStudColor;
|
mStudColor = lcGetPreferences().mStudColor;
|
||||||
mStudEdgeColor = lcGetPreferences().mStudEdgeColor;
|
mStudEdgeColor = lcGetPreferences().mStudEdgeColor;
|
||||||
|
mBlackEdgeColor = lcGetPreferences().mBlackEdgeColor;
|
||||||
|
mDarkEdgeColor = lcGetPreferences().mDarkEdgeColor;
|
||||||
|
|
||||||
mPartEdgeContrast = lcGetPreferences().mPartEdgeContrast;
|
mPartEdgeContrast = lcGetPreferences().mPartEdgeContrast;
|
||||||
mPartEdgeGamma = lcGetPreferences().mPartEdgeGamma;
|
mPartEdgeGamma = lcGetPreferences().mPartEdgeGamma;
|
||||||
mPartColorValueLDIndex = lcGetPreferences().mPartColorValueLDIndex;
|
mPartColorValueLDIndex = lcGetPreferences().mPartColorValueLDIndex;
|
||||||
|
@ -16,6 +19,7 @@ lcAutomateEdgeColorDialog::lcAutomateEdgeColorDialog(QWidget* Parent)
|
||||||
QVBoxLayout* MainLayout = new QVBoxLayout(this);
|
QVBoxLayout* MainLayout = new QVBoxLayout(this);
|
||||||
|
|
||||||
QGroupBox* EdgeSettingsBox = new QGroupBox(tr("Edge Colors"), this);
|
QGroupBox* EdgeSettingsBox = new QGroupBox(tr("Edge Colors"), this);
|
||||||
|
EdgeSettingsBox->setVisible(!ShowHighContrastDialog);
|
||||||
MainLayout->addWidget(EdgeSettingsBox);
|
MainLayout->addWidget(EdgeSettingsBox);
|
||||||
QGridLayout* EdgeSettingsLayout = new QGridLayout(EdgeSettingsBox);
|
QGridLayout* EdgeSettingsLayout = new QGridLayout(EdgeSettingsBox);
|
||||||
EdgeSettingsBox->setLayout(EdgeSettingsLayout);
|
EdgeSettingsBox->setLayout(EdgeSettingsLayout);
|
||||||
|
@ -60,6 +64,7 @@ lcAutomateEdgeColorDialog::lcAutomateEdgeColorDialog(QWidget* Parent)
|
||||||
EdgeSettingsLayout->addWidget(PartColorValueLDIndex,2,2);
|
EdgeSettingsLayout->addWidget(PartColorValueLDIndex,2,2);
|
||||||
|
|
||||||
QGroupBox* StudColorBox = new QGroupBox(tr("High Contrast Studs"), this);
|
QGroupBox* StudColorBox = new QGroupBox(tr("High Contrast Studs"), this);
|
||||||
|
StudColorBox->setVisible(ShowHighContrastDialog);
|
||||||
MainLayout->addWidget(StudColorBox);
|
MainLayout->addWidget(StudColorBox);
|
||||||
QGridLayout* StudColorLayout = new QGridLayout(StudColorBox);
|
QGridLayout* StudColorLayout = new QGridLayout(StudColorBox);
|
||||||
StudColorBox->setLayout(StudColorLayout);
|
StudColorBox->setLayout(StudColorLayout);
|
||||||
|
@ -101,6 +106,34 @@ lcAutomateEdgeColorDialog::lcAutomateEdgeColorDialog(QWidget* Parent)
|
||||||
StudColorLayout->addWidget(StudEdgeColorButton,1,1);
|
StudColorLayout->addWidget(StudEdgeColorButton,1,1);
|
||||||
StudColorLayout->addWidget(ResetStudEdgeColorButton,1,2);
|
StudColorLayout->addWidget(ResetStudEdgeColorButton,1,2);
|
||||||
|
|
||||||
|
QLabel* BlackEdgeColorLabel = new QLabel(tr("Black Parts Edge Color:"), this);
|
||||||
|
BlackEdgeColorButton = new QToolButton(this);
|
||||||
|
SetButtonPixmap(mBlackEdgeColor, BlackEdgeColorButton);
|
||||||
|
connect(BlackEdgeColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked()));
|
||||||
|
|
||||||
|
ResetBlackEdgeColorButton = new QToolButton(this);
|
||||||
|
ResetBlackEdgeColorButton->setText(tr("..."));
|
||||||
|
ResetBlackEdgeColorButton->setToolTip(tr("Reset"));
|
||||||
|
connect(ResetBlackEdgeColorButton, SIGNAL(clicked()), this, SLOT(ResetColorButtonClicked()));
|
||||||
|
|
||||||
|
StudColorLayout->addWidget(BlackEdgeColorLabel,2,0);
|
||||||
|
StudColorLayout->addWidget(BlackEdgeColorButton,2,1);
|
||||||
|
StudColorLayout->addWidget(ResetBlackEdgeColorButton,2,2);
|
||||||
|
|
||||||
|
QLabel* DarkEdgeColorLabel = new QLabel(tr("Dark Parts Edge Color:"), this);
|
||||||
|
DarkEdgeColorButton = new QToolButton(this);
|
||||||
|
SetButtonPixmap(mDarkEdgeColor, DarkEdgeColorButton);
|
||||||
|
connect(DarkEdgeColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked()));
|
||||||
|
|
||||||
|
ResetDarkEdgeColorButton = new QToolButton(this);
|
||||||
|
ResetDarkEdgeColorButton->setText(tr("..."));
|
||||||
|
ResetDarkEdgeColorButton->setToolTip(tr("Reset"));
|
||||||
|
connect(ResetDarkEdgeColorButton, SIGNAL(clicked()), this, SLOT(ResetColorButtonClicked()));
|
||||||
|
|
||||||
|
StudColorLayout->addWidget(DarkEdgeColorLabel,3,0);
|
||||||
|
StudColorLayout->addWidget(DarkEdgeColorButton,3,1);
|
||||||
|
StudColorLayout->addWidget(ResetDarkEdgeColorButton,3,2);
|
||||||
|
|
||||||
QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
|
QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
|
||||||
MainLayout->addWidget(buttonBox);
|
MainLayout->addWidget(buttonBox);
|
||||||
QObject::connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
QObject::connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||||
|
@ -145,6 +178,16 @@ void lcAutomateEdgeColorDialog::ColorButtonClicked()
|
||||||
Title = tr("Select Stud Edge Color");
|
Title = tr("Select Stud Edge Color");
|
||||||
Color = &mStudEdgeColor;
|
Color = &mStudEdgeColor;
|
||||||
}
|
}
|
||||||
|
else if (Button == BlackEdgeColorButton)
|
||||||
|
{
|
||||||
|
Title = tr("Select Black Edge Color");
|
||||||
|
Color = &mBlackEdgeColor;
|
||||||
|
}
|
||||||
|
else if (Button == DarkEdgeColorButton)
|
||||||
|
{
|
||||||
|
Title = tr("Select Dark Edge Color");
|
||||||
|
Color = &mDarkEdgeColor;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -187,4 +230,22 @@ void lcAutomateEdgeColorDialog::ResetColorButtonClicked()
|
||||||
StudEdgeColorButton->setIcon(Pix);
|
StudEdgeColorButton->setIcon(Pix);
|
||||||
StudEdgeColorButton->setToolTip(ResetColor.name().toUpper());
|
StudEdgeColorButton->setToolTip(ResetColor.name().toUpper());
|
||||||
}
|
}
|
||||||
|
else if (sender() == BlackEdgeColorButton)
|
||||||
|
{
|
||||||
|
Color = &mBlackEdgeColor;
|
||||||
|
*Color = LC_RGBA(0, 0, 0, 255);
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
else if (sender() == DarkEdgeColorButton)
|
||||||
|
{
|
||||||
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,9 +6,11 @@ class lcAutomateEdgeColorDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
lcAutomateEdgeColorDialog(QWidget *Parent);
|
lcAutomateEdgeColorDialog(QWidget *Parent, bool ShowHighContrastDialog);
|
||||||
quint32 mStudColor;
|
quint32 mStudColor;
|
||||||
quint32 mStudEdgeColor;
|
quint32 mStudEdgeColor;
|
||||||
|
quint32 mDarkEdgeColor;
|
||||||
|
quint32 mBlackEdgeColor;
|
||||||
float mPartEdgeContrast;
|
float mPartEdgeContrast;
|
||||||
float mPartEdgeGamma;
|
float mPartEdgeGamma;
|
||||||
float mPartColorValueLDIndex;
|
float mPartColorValueLDIndex;
|
||||||
|
@ -23,13 +25,18 @@ protected:
|
||||||
QSlider* PartColorValueLDIndexSlider;
|
QSlider* PartColorValueLDIndexSlider;
|
||||||
QSlider* PartEdgeContrastSlider;
|
QSlider* PartEdgeContrastSlider;
|
||||||
|
|
||||||
QToolButton* StudColorButton;
|
|
||||||
QToolButton* StudEdgeColorButton;
|
|
||||||
QToolButton* ResetStudColorButton;
|
|
||||||
QToolButton* ResetStudEdgeColorButton;
|
|
||||||
|
|
||||||
QLabel* PartEdgeContrast;
|
QLabel* PartEdgeContrast;
|
||||||
QLabel* PartEdgeGamma;
|
QLabel* PartEdgeGamma;
|
||||||
QLabel* PartColorValueLDIndex;
|
QLabel* PartColorValueLDIndex;
|
||||||
|
|
||||||
|
QToolButton* StudColorButton;
|
||||||
|
QToolButton* StudEdgeColorButton;
|
||||||
|
QToolButton* BlackEdgeColorButton;
|
||||||
|
QToolButton* DarkEdgeColorButton;
|
||||||
|
|
||||||
|
QToolButton* ResetStudColorButton;
|
||||||
|
QToolButton* ResetStudEdgeColorButton;
|
||||||
|
QToolButton* ResetBlackEdgeColorButton;
|
||||||
|
QToolButton* ResetDarkEdgeColorButton;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -142,9 +142,11 @@ static lcProfileEntry gProfileEntries[LC_NUM_PROFILE_KEYS] =
|
||||||
|
|
||||||
lcProfileEntry("Settings", "StudColor", LC_RGBA(27, 42, 52, 255)), // LC_PROFILE_STUD_COLOR
|
lcProfileEntry("Settings", "StudColor", LC_RGBA(27, 42, 52, 255)), // LC_PROFILE_STUD_COLOR
|
||||||
lcProfileEntry("Settings", "StudEdgeColor", LC_RGBA(0, 0, 0, 255)), // LC_PROFILE_STUD_EDGE_COLOR
|
lcProfileEntry("Settings", "StudEdgeColor", LC_RGBA(0, 0, 0, 255)), // LC_PROFILE_STUD_EDGE_COLOR
|
||||||
lcProfileEntry("Settings", "PartEdgeContrast", 0.50f), // LC_PROFILE_PART_EDGE_CONTRAST
|
lcProfileEntry("Settings", "BlackEdgeColor", LC_RGBA(255, 255, 255, 255)), // LC_PROFILE_BLACK_EDGE_COLOR
|
||||||
lcProfileEntry("Settings", "PartEdgeGamma", 2.20f), // LC_PROFILE_PART_EDGE_GAMMA
|
lcProfileEntry("Settings", "DarkEdgeColor", LC_RGBA(27, 42, 52, 255)), // LC_PROFILE_DARK_EDGE_COLOR
|
||||||
lcProfileEntry("Settings", "PartColorValueLDIndex", 0.50f), // LC_PROFILE_PART_COLOR_VALUE_LD_INDEX
|
lcProfileEntry("Settings", "PartEdgeContrast", 0.5f), // LC_PROFILE_PART_EDGE_CONTRAST
|
||||||
|
lcProfileEntry("Settings", "PartEdgeGamma", 1.8f), // LC_PROFILE_PART_EDGE_GAMMA
|
||||||
|
lcProfileEntry("Settings", "mPartColorValueLDIndex", 0.5f), // LC_PROFILE_PART_COLOR_VALUE_LD_INDEX
|
||||||
lcProfileEntry("Settings", "AutomateEdgeColor", 0) // LC_PROFILE_AUTOMATE_EDGE_COLOR
|
lcProfileEntry("Settings", "AutomateEdgeColor", 0) // LC_PROFILE_AUTOMATE_EDGE_COLOR
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,8 @@ enum LC_PROFILE_KEY
|
||||||
|
|
||||||
LC_PROFILE_STUD_COLOR,
|
LC_PROFILE_STUD_COLOR,
|
||||||
LC_PROFILE_STUD_EDGE_COLOR,
|
LC_PROFILE_STUD_EDGE_COLOR,
|
||||||
|
LC_PROFILE_BLACK_EDGE_COLOR,
|
||||||
|
LC_PROFILE_DARK_EDGE_COLOR,
|
||||||
LC_PROFILE_PART_EDGE_CONTRAST,
|
LC_PROFILE_PART_EDGE_CONTRAST,
|
||||||
LC_PROFILE_PART_EDGE_GAMMA,
|
LC_PROFILE_PART_EDGE_GAMMA,
|
||||||
LC_PROFILE_PART_COLOR_VALUE_LD_INDEX,
|
LC_PROFILE_PART_COLOR_VALUE_LD_INDEX,
|
||||||
|
|
|
@ -47,6 +47,7 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
|
||||||
ui->shortcutEdit->installEventFilter(this);
|
ui->shortcutEdit->installEventFilter(this);
|
||||||
connect(ui->commandList, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(commandChanged(QTreeWidgetItem*)));
|
connect(ui->commandList, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(commandChanged(QTreeWidgetItem*)));
|
||||||
connect(ui->mouseTree, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(MouseTreeItemChanged(QTreeWidgetItem*)));
|
connect(ui->mouseTree, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(MouseTreeItemChanged(QTreeWidgetItem*)));
|
||||||
|
connect(ui->HighContrastButton, SIGNAL(clicked()), this, SLOT(AutomateEdgeColor()));
|
||||||
connect(ui->AutomateEdgeColorButton, SIGNAL(clicked()), this, SLOT(AutomateEdgeColor()));
|
connect(ui->AutomateEdgeColorButton, SIGNAL(clicked()), this, SLOT(AutomateEdgeColor()));
|
||||||
|
|
||||||
ui->partsLibrary->setText(mOptions->LibraryPath);
|
ui->partsLibrary->setText(mOptions->LibraryPath);
|
||||||
|
@ -557,13 +558,20 @@ void lcQPreferencesDialog::on_AutomateEdgeColor_toggled()
|
||||||
ui->AutomateEdgeColorButton->setEnabled(ui->AutomateEdgeColor->isChecked());
|
ui->AutomateEdgeColorButton->setEnabled(ui->AutomateEdgeColor->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void lcQPreferencesDialog::on_studStyleCombo_currentIndexChanged(int index)
|
||||||
|
{
|
||||||
|
ui->HighContrastButton->setEnabled(index > static_cast<int>(lcStudStyle::FlattenedLogo));
|
||||||
|
}
|
||||||
|
|
||||||
void lcQPreferencesDialog::AutomateEdgeColor()
|
void lcQPreferencesDialog::AutomateEdgeColor()
|
||||||
{
|
{
|
||||||
lcAutomateEdgeColorDialog Dialog(this);
|
lcAutomateEdgeColorDialog Dialog(this, sender() == ui->HighContrastButton);
|
||||||
if (Dialog.exec() == QDialog::Accepted)
|
if (Dialog.exec() == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
mOptions->Preferences.mStudColor = Dialog.mStudColor;
|
mOptions->Preferences.mStudColor = Dialog.mStudColor;
|
||||||
mOptions->Preferences.mStudEdgeColor = Dialog.mStudEdgeColor;
|
mOptions->Preferences.mStudEdgeColor = Dialog.mStudEdgeColor;
|
||||||
|
mOptions->Preferences.mBlackEdgeColor = Dialog.mBlackEdgeColor;
|
||||||
|
mOptions->Preferences.mDarkEdgeColor = Dialog.mDarkEdgeColor;
|
||||||
mOptions->Preferences.mPartEdgeContrast = Dialog.mPartEdgeContrast;
|
mOptions->Preferences.mPartEdgeContrast = Dialog.mPartEdgeContrast;
|
||||||
mOptions->Preferences.mPartEdgeGamma = Dialog.mPartEdgeGamma;
|
mOptions->Preferences.mPartEdgeGamma = Dialog.mPartEdgeGamma;
|
||||||
mOptions->Preferences.mPartColorValueLDIndex = Dialog.mPartColorValueLDIndex;
|
mOptions->Preferences.mPartColorValueLDIndex = Dialog.mPartColorValueLDIndex;
|
||||||
|
|
|
@ -67,6 +67,7 @@ public slots:
|
||||||
void ColorButtonClicked();
|
void ColorButtonClicked();
|
||||||
void AutomateEdgeColor();
|
void AutomateEdgeColor();
|
||||||
void on_AutomateEdgeColor_toggled();
|
void on_AutomateEdgeColor_toggled();
|
||||||
|
void on_studStyleCombo_currentIndexChanged(int index);
|
||||||
void on_antiAliasing_toggled();
|
void on_antiAliasing_toggled();
|
||||||
void on_edgeLines_toggled();
|
void on_edgeLines_toggled();
|
||||||
void on_LineWidthSlider_valueChanged();
|
void on_LineWidthSlider_valueChanged();
|
||||||
|
|
|
@ -402,25 +402,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="1" colspan="2">
|
|
||||||
<widget class="QComboBox" name="ShadingMode">
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Wireframe</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Flat Shading</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Default Lights</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QSlider" name="MeshLODSlider">
|
<widget class="QSlider" name="MeshLODSlider">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -547,10 +528,36 @@
|
||||||
<item row="7" column="0">
|
<item row="7" column="0">
|
||||||
<widget class="QCheckBox" name="AutomateEdgeColor">
|
<widget class="QCheckBox" name="AutomateEdgeColor">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Automate edge color:</string>
|
<string>Automate edge color</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="10" column="2">
|
||||||
|
<widget class="QToolButton" name="HighContrastButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="11" column="1">
|
||||||
|
<widget class="QComboBox" name="ShadingMode">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Wireframe</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Flat Shading</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Default Lights</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -1733,6 +1740,7 @@
|
||||||
<tabstop>HighlightNewParts</tabstop>
|
<tabstop>HighlightNewParts</tabstop>
|
||||||
<tabstop>HighlightNewPartsColor</tabstop>
|
<tabstop>HighlightNewPartsColor</tabstop>
|
||||||
<tabstop>studStyleCombo</tabstop>
|
<tabstop>studStyleCombo</tabstop>
|
||||||
|
<tabstop>HighContrastButton</tabstop>
|
||||||
<tabstop>ShadingMode</tabstop>
|
<tabstop>ShadingMode</tabstop>
|
||||||
<tabstop>ViewSphereSizeCombo</tabstop>
|
<tabstop>ViewSphereSizeCombo</tabstop>
|
||||||
<tabstop>ViewSphereLocationCombo</tabstop>
|
<tabstop>ViewSphereLocationCombo</tabstop>
|
||||||
|
@ -1745,8 +1753,8 @@
|
||||||
<tabstop>PreviewViewSphereLocationCombo</tabstop>
|
<tabstop>PreviewViewSphereLocationCombo</tabstop>
|
||||||
<tabstop>PreviewAxisIconCheckBox</tabstop>
|
<tabstop>PreviewAxisIconCheckBox</tabstop>
|
||||||
<tabstop>BackgroundSolidRadio</tabstop>
|
<tabstop>BackgroundSolidRadio</tabstop>
|
||||||
<tabstop>BackgroundGradientRadio</tabstop>
|
|
||||||
<tabstop>BackgroundSolidColorButton</tabstop>
|
<tabstop>BackgroundSolidColorButton</tabstop>
|
||||||
|
<tabstop>BackgroundGradientRadio</tabstop>
|
||||||
<tabstop>BackgroundGradient1ColorButton</tabstop>
|
<tabstop>BackgroundGradient1ColorButton</tabstop>
|
||||||
<tabstop>BackgroundGradient2ColorButton</tabstop>
|
<tabstop>BackgroundGradient2ColorButton</tabstop>
|
||||||
<tabstop>ActiveViewColorButton</tabstop>
|
<tabstop>ActiveViewColorButton</tabstop>
|
||||||
|
|
Loading…
Add table
Reference in a new issue