mirror of
https://github.com/leozide/leocad
synced 2025-01-17 18:11:42 +01:00
Allow highlight color to be set by the user.
This commit is contained in:
parent
b7f57c03f0
commit
acd7dd3f9a
18 changed files with 144 additions and 102 deletions
|
@ -22,6 +22,8 @@ void lcPreferences::LoadDefaults()
|
|||
mLineWidth = lcGetProfileFloat(LC_PROFILE_LINE_WIDTH);
|
||||
mAllowLOD = lcGetProfileInt(LC_PROFILE_ALLOW_LOD);
|
||||
mFadeSteps = lcGetProfileInt(LC_PROFILE_FADE_STEPS);
|
||||
mHighlightNewParts = lcGetProfileInt(LC_PROFILE_HIGHLIGHT_NEW_PARTS);
|
||||
mHighlightNewPartsColor = lcGetProfileInt(LC_PROFILE_HIGHLIGHT_NEW_PARTS_COLOR);
|
||||
mDrawGridStuds = lcGetProfileInt(LC_PROFILE_GRID_STUDS);
|
||||
mGridStudColor = lcGetProfileInt(LC_PROFILE_GRID_STUD_COLOR);
|
||||
mDrawGridLines = lcGetProfileInt(LC_PROFILE_GRID_LINES);
|
||||
|
@ -47,6 +49,8 @@ void lcPreferences::SaveDefaults()
|
|||
lcSetProfileFloat(LC_PROFILE_LINE_WIDTH, mLineWidth);
|
||||
lcSetProfileInt(LC_PROFILE_ALLOW_LOD, mAllowLOD);
|
||||
lcSetProfileInt(LC_PROFILE_FADE_STEPS, mFadeSteps);
|
||||
lcSetProfileInt(LC_PROFILE_HIGHLIGHT_NEW_PARTS, mHighlightNewParts);
|
||||
lcSetProfileInt(LC_PROFILE_HIGHLIGHT_NEW_PARTS_COLOR, mHighlightNewPartsColor);
|
||||
lcSetProfileInt(LC_PROFILE_GRID_STUDS, mDrawGridStuds);
|
||||
lcSetProfileInt(LC_PROFILE_GRID_STUD_COLOR, mGridStudColor);
|
||||
lcSetProfileInt(LC_PROFILE_GRID_LINES, mDrawGridLines);
|
||||
|
@ -194,7 +198,7 @@ bool lcApplication::Initialize(QList<QPair<QString, bool>>& LibraryPaths, bool&
|
|||
bool SaveHTML = false;
|
||||
bool SetCameraAngles = false;
|
||||
bool Orthographic = false;
|
||||
bool ImageHighlight = false;
|
||||
bool ImageHighlight = mPreferences.mHighlightNewParts;
|
||||
int ImageWidth = lcGetProfileInt(LC_PROFILE_IMAGE_WIDTH);
|
||||
int ImageHeight = lcGetProfileInt(LC_PROFILE_IMAGE_HEIGHT);
|
||||
int StudLogo = lcGetProfileInt(LC_PROFILE_STUD_LOGO);
|
||||
|
@ -544,7 +548,9 @@ bool lcApplication::Initialize(QList<QPair<QString, bool>>& LibraryPaths, bool&
|
|||
else
|
||||
Frame = ImageName;
|
||||
|
||||
ActiveModel->SaveStepImages(Frame, ImageStart != ImageEnd, CameraName == nullptr, ImageHighlight, ImageWidth, ImageHeight, ImageStart, ImageEnd);
|
||||
mPreferences.mHighlightNewParts = ImageHighlight;
|
||||
|
||||
ActiveModel->SaveStepImages(Frame, ImageStart != ImageEnd, CameraName == nullptr, ImageWidth, ImageHeight, ImageStart, ImageEnd);
|
||||
}
|
||||
|
||||
if (SaveWavefront)
|
||||
|
|
|
@ -34,6 +34,8 @@ public:
|
|||
float mLineWidth;
|
||||
bool mAllowLOD;
|
||||
bool mFadeSteps;
|
||||
bool mHighlightNewParts;
|
||||
quint32 mHighlightNewPartsColor;
|
||||
bool mDrawGridStuds;
|
||||
quint32 mGridStudColor;
|
||||
bool mDrawGridLines;
|
||||
|
|
|
@ -1108,7 +1108,7 @@ void lcMainWindow::Print(QPrinter* Printer)
|
|||
|
||||
lcModel* Model = PageLayouts[Page - 1].first;
|
||||
lcStep Step = PageLayouts[Page - 1].second;
|
||||
QImage Image = Model->GetStepImage(false, false, StepWidth, StepHeight, Step);
|
||||
QImage Image = Model->GetStepImage(false, StepWidth, StepHeight, Step);
|
||||
|
||||
Painter.drawImage(MarginRect.left(), MarginRect.top(), Image);
|
||||
|
||||
|
|
|
@ -1362,7 +1362,7 @@ void lcModel::DrawBackground(lcGLWidget* Widget)
|
|||
Context->SetDepthWrite(true);
|
||||
}
|
||||
|
||||
QImage lcModel::GetStepImage(bool Zoom, bool Highlight, int Width, int Height, lcStep Step)
|
||||
QImage lcModel::GetStepImage(bool Zoom, int Width, int Height, lcStep Step)
|
||||
{
|
||||
View* ActiveView = gMainWindow->GetActiveView();
|
||||
ActiveView->MakeCurrent();
|
||||
|
@ -1375,7 +1375,6 @@ QImage lcModel::GetStepImage(bool Zoom, bool Highlight, int Width, int Height, l
|
|||
ZoomExtents(Camera, (float)Width / (float)Height);
|
||||
|
||||
View View(this);
|
||||
View.SetHighlight(Highlight);
|
||||
View.SetCamera(Camera, false);
|
||||
View.SetContext(Context);
|
||||
|
||||
|
@ -1620,7 +1619,7 @@ QImage lcModel::GetPartsListImage(int MaxWidth, lcStep Step) const
|
|||
return PainterImage;
|
||||
}
|
||||
|
||||
void lcModel::SaveStepImages(const QString& BaseName, bool AddStepSuffix, bool Zoom, bool Highlight, int Width, int Height, lcStep Start, lcStep End)
|
||||
void lcModel::SaveStepImages(const QString& BaseName, bool AddStepSuffix, bool Zoom, int Width, int Height, lcStep Start, lcStep End)
|
||||
{
|
||||
for (lcStep Step = Start; Step <= End; Step++)
|
||||
{
|
||||
|
@ -1636,7 +1635,7 @@ void lcModel::SaveStepImages(const QString& BaseName, bool AddStepSuffix, bool Z
|
|||
if (Writer.format().isEmpty())
|
||||
Writer.setFormat("png");
|
||||
|
||||
QImage Image = GetStepImage(Zoom, Highlight, Width, Height, Step);
|
||||
QImage Image = GetStepImage(Zoom, Width, Height, Step);
|
||||
if (!Writer.write(Image))
|
||||
{
|
||||
QMessageBox::information(gMainWindow, tr("Error"), tr("Error writing to file '%1':\n%2").arg(FileName, Writer.errorString()));
|
||||
|
|
|
@ -228,9 +228,9 @@ public:
|
|||
void GetScene(lcScene& Scene, lcCamera* ViewCamera, bool AllowHighlight, bool AllowFade) const;
|
||||
void AddSubModelRenderMeshes(lcScene& Scene, const lcMatrix44& WorldMatrix, int DefaultColorIndex, lcRenderMeshState RenderMeshState, bool ParentActive) const;
|
||||
void DrawBackground(lcGLWidget* Widget);
|
||||
QImage GetStepImage(bool Zoom, bool Highlight, int Width, int Height, lcStep Step);
|
||||
QImage GetStepImage(bool Zoom, int Width, int Height, lcStep Step);
|
||||
QImage GetPartsListImage(int MaxWidth, lcStep Step) const;
|
||||
void SaveStepImages(const QString& BaseName, bool AddStepSuffix, bool Zoom, bool Highlight, int Width, int Height, lcStep Start, lcStep End);
|
||||
void SaveStepImages(const QString& BaseName, bool AddStepSuffix, bool Zoom, int Width, int Height, lcStep Start, lcStep End);
|
||||
std::vector<std::pair<lcModel*, lcStep>> GetPageLayouts(std::vector<const lcModel*>& AddedModels);
|
||||
|
||||
void RayTest(lcObjectRayTest& ObjectRayTest) const;
|
||||
|
|
|
@ -59,6 +59,8 @@ static lcProfileEntry gProfileEntries[LC_NUM_PROFILE_KEYS] =
|
|||
lcProfileEntry("Settings", "LineWidth", 1.0f), // LC_PROFILE_LINE_WIDTH
|
||||
lcProfileEntry("Settings", "AllowLOD", true), // LC_PROFILE_ALLOW_LOD
|
||||
lcProfileEntry("Settings", "FadeSteps", false), // LC_PROFILE_FADE_STEPS
|
||||
lcProfileEntry("Settings", "HighlightNewParts", 0), // LC_PROFILE_HIGHLIGHT_NEW_PARTS
|
||||
lcProfileEntry("Settings", "HighlightNewPartsColor", LC_RGBA(255, 242, 0, 192)), // LC_PROFILE_HIGHLIGHT_NEW_PARTS_COLOR
|
||||
lcProfileEntry("Settings", "ShadingMode", static_cast<int>(lcShadingMode::DefaultLights)), // LC_PROFILE_SHADING_MODE
|
||||
lcProfileEntry("Settings", "DrawAxes", 0), // LC_PROFILE_DRAW_AXES
|
||||
lcProfileEntry("Settings", "DrawEdgeLines", 1), // LC_PROFILE_DRAW_EDGE_LINES
|
||||
|
|
|
@ -7,6 +7,8 @@ enum LC_PROFILE_KEY
|
|||
LC_PROFILE_LINE_WIDTH,
|
||||
LC_PROFILE_ALLOW_LOD,
|
||||
LC_PROFILE_FADE_STEPS,
|
||||
LC_PROFILE_HIGHLIGHT_NEW_PARTS,
|
||||
LC_PROFILE_HIGHLIGHT_NEW_PARTS_COLOR,
|
||||
LC_PROFILE_SHADING_MODE,
|
||||
LC_PROFILE_DRAW_AXES,
|
||||
LC_PROFILE_DRAW_EDGE_LINES,
|
||||
|
|
|
@ -218,7 +218,7 @@ void lcScene::DrawOpaqueMeshes(lcContext* Context, bool DrawLit, int PrimitiveTy
|
|||
break;
|
||||
|
||||
case lcRenderMeshState::Highlighted:
|
||||
Context->SetInterfaceColor(LC_COLOR_HIGHLIGHT);
|
||||
Context->SetColor(lcVector4FromColor(lcGetPreferences().mHighlightNewPartsColor));
|
||||
break;
|
||||
|
||||
case lcRenderMeshState::Faded:
|
||||
|
|
|
@ -654,6 +654,9 @@ void lcPiece::AddMainModelRenderMeshes(lcScene& Scene, bool Highlight, bool Fade
|
|||
lcRenderMeshState RenderMeshState = lcRenderMeshState::Default;
|
||||
bool ParentActive = false;
|
||||
|
||||
if (Highlight)
|
||||
RenderMeshState = lcRenderMeshState::Highlighted;
|
||||
|
||||
if (Fade)
|
||||
RenderMeshState = lcRenderMeshState::Faded;
|
||||
|
||||
|
@ -668,8 +671,6 @@ void lcPiece::AddMainModelRenderMeshes(lcScene& Scene, bool Highlight, bool Fade
|
|||
else
|
||||
RenderMeshState = lcRenderMeshState::Faded;
|
||||
}
|
||||
else if (Highlight)
|
||||
RenderMeshState = lcRenderMeshState::Highlighted;
|
||||
|
||||
if (!mMesh)
|
||||
mPieceInfo->AddRenderMeshes(Scene, mModelWorld, mColorIndex, RenderMeshState, ParentActive);
|
||||
|
|
|
@ -33,7 +33,6 @@ lcHTMLExportOptions::lcHTMLExportOptions(const Project* Project)
|
|||
IndexPage = (HTMLOptions & LC_HTML_INDEX) != 0;
|
||||
StepImagesWidth = lcGetProfileInt(LC_PROFILE_HTML_IMAGE_WIDTH);
|
||||
StepImagesHeight = lcGetProfileInt(LC_PROFILE_HTML_IMAGE_HEIGHT);
|
||||
HighlightNewParts = (HTMLOptions & LC_HTML_HIGHLIGHT) != 0;
|
||||
PartsListStep = (HTMLOptions & LC_HTML_LISTSTEP) != 0;
|
||||
PartsListEnd = (HTMLOptions & LC_HTML_LISTEND) != 0;
|
||||
}
|
||||
|
@ -50,8 +49,6 @@ void lcHTMLExportOptions::SaveDefaults()
|
|||
HTMLOptions |= LC_HTML_SINGLEPAGE;
|
||||
if (IndexPage)
|
||||
HTMLOptions |= LC_HTML_INDEX;
|
||||
if (HighlightNewParts)
|
||||
HTMLOptions |= LC_HTML_HIGHLIGHT;
|
||||
if (PartsListStep)
|
||||
HTMLOptions |= LC_HTML_LISTSTEP;
|
||||
if (PartsListEnd)
|
||||
|
@ -1656,7 +1653,7 @@ void Project::ExportHTML(const lcHTMLExportOptions& Options)
|
|||
}
|
||||
|
||||
QString StepImageBaseName = QFileInfo(Dir, BaseName + QLatin1String("-%1.png")).absoluteFilePath();
|
||||
Model->SaveStepImages(StepImageBaseName, true, false, Options.HighlightNewParts, Options.StepImagesWidth, Options.StepImagesHeight, 1, LastStep);
|
||||
Model->SaveStepImages(StepImageBaseName, true, false, Options.StepImagesWidth, Options.StepImagesHeight, 1, LastStep);
|
||||
}
|
||||
|
||||
if (Models.GetSize() > 1)
|
||||
|
@ -2147,7 +2144,7 @@ void Project::SaveImage()
|
|||
if (Dialog.mStart != Dialog.mEnd)
|
||||
Dialog.mFileName = Dialog.mFileName.insert(Dialog.mFileName.length() - Extension.length() - 1, QLatin1String("%1"));
|
||||
|
||||
mActiveModel->SaveStepImages(Dialog.mFileName, Dialog.mStart != Dialog.mEnd, false, false, Dialog.mWidth, Dialog.mHeight, Dialog.mStart, Dialog.mEnd);
|
||||
mActiveModel->SaveStepImages(Dialog.mFileName, Dialog.mStart != Dialog.mEnd, false, Dialog.mWidth, Dialog.mHeight, Dialog.mStart, Dialog.mEnd);
|
||||
}
|
||||
|
||||
void Project::UpdatePieceInfo(PieceInfo* Info) const
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#define LC_HTML_INDEX 0x02
|
||||
#define LC_HTML_LISTEND 0x08
|
||||
#define LC_HTML_LISTSTEP 0x10
|
||||
#define LC_HTML_HIGHLIGHT 0x20
|
||||
#define LC_HTML_SUBMODELS 0x40
|
||||
#define LC_HTML_CURRENT_ONLY 0x80
|
||||
|
||||
|
@ -26,7 +25,6 @@ public:
|
|||
bool IndexPage;
|
||||
int StepImagesWidth;
|
||||
int StepImagesHeight;
|
||||
bool HighlightNewParts;
|
||||
bool PartsListStep;
|
||||
bool PartsListEnd;
|
||||
};
|
||||
|
|
|
@ -18,7 +18,6 @@ View::View(lcModel* Model)
|
|||
mModel = Model;
|
||||
mActiveSubmodelInstance = nullptr;
|
||||
mCamera = nullptr;
|
||||
mHighlight = false;
|
||||
memset(mGridSettings, 0, sizeof(mGridSettings));
|
||||
|
||||
mDragState = lcDragState::None;
|
||||
|
@ -820,7 +819,7 @@ void View::OnDraw()
|
|||
mScene.SetActiveSubmodelInstance(mActiveSubmodelInstance, mActiveSubmodelTransform);
|
||||
mScene.SetDrawInterface(DrawInterface);
|
||||
|
||||
mModel->GetScene(mScene, mCamera, mHighlight, Preferences.mFadeSteps);
|
||||
mModel->GetScene(mScene, mCamera, Preferences.mHighlightNewParts, Preferences.mFadeSteps);
|
||||
|
||||
if (DrawInterface && mTrackTool == LC_TRACKTOOL_INSERT)
|
||||
{
|
||||
|
|
|
@ -77,11 +77,6 @@ public:
|
|||
void SetTopSubmodelActive();
|
||||
void SetSelectedSubmodelActive();
|
||||
|
||||
void SetHighlight(bool Highlight)
|
||||
{
|
||||
mHighlight = Highlight;
|
||||
}
|
||||
|
||||
static void CreateResources(lcContext* Context);
|
||||
static void DestroyResources(lcContext* Context);
|
||||
|
||||
|
@ -198,7 +193,6 @@ protected:
|
|||
int mMouseDownY;
|
||||
lcVector3 mMouseDownPosition;
|
||||
PieceInfo* mMouseDownPiece;
|
||||
bool mHighlight;
|
||||
QImage mRenderImage;
|
||||
std::pair<lcFramebuffer, lcFramebuffer> mRenderFramebuffer;
|
||||
lcViewSphere mViewSphere;
|
||||
|
|
|
@ -28,7 +28,6 @@ lcQHTMLDialog::lcQHTMLDialog(QWidget* Parent, lcHTMLExportOptions* Options)
|
|||
ui->indexPage->setChecked(mOptions->SinglePage);
|
||||
ui->stepWidth->setText(QString::number(mOptions->StepImagesWidth));
|
||||
ui->stepHeight->setText(QString::number(mOptions->StepImagesHeight));
|
||||
ui->highlightNewParts->setChecked(mOptions->HighlightNewParts);
|
||||
ui->partsAfterEachStep->setChecked(mOptions->PartsListStep);
|
||||
ui->partsAtTheEnd->setChecked(mOptions->PartsListEnd);
|
||||
}
|
||||
|
@ -56,7 +55,6 @@ void lcQHTMLDialog::accept()
|
|||
mOptions->IndexPage = ui->indexPage->isChecked();
|
||||
mOptions->StepImagesWidth = ui->stepWidth->text().toInt();
|
||||
mOptions->StepImagesHeight = ui->stepHeight->text().toInt();
|
||||
mOptions->HighlightNewParts = ui->highlightNewParts->isChecked();
|
||||
mOptions->PartsListStep = ui->partsAfterEachStep->isChecked();
|
||||
mOptions->PartsListEnd = ui->partsAtTheEnd->isChecked();
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>612</height>
|
||||
<height>460</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -163,13 +163,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="highlightNewParts">
|
||||
<property name="text">
|
||||
<string>Highlight new parts</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -220,7 +213,6 @@
|
|||
<tabstop>indexPage</tabstop>
|
||||
<tabstop>stepWidth</tabstop>
|
||||
<tabstop>stepHeight</tabstop>
|
||||
<tabstop>highlightNewParts</tabstop>
|
||||
<tabstop>partsAtTheEnd</tabstop>
|
||||
<tabstop>partsAfterEachStep</tabstop>
|
||||
</tabstops>
|
||||
|
|
|
@ -29,6 +29,7 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
|
|||
#endif
|
||||
|
||||
ui->lineWidth->setValidator(new QDoubleValidator(ui->lineWidth));
|
||||
connect(ui->HighlightNewPartsColor, SIGNAL(clicked()), this, SLOT(ColorButtonClicked()));
|
||||
connect(ui->gridStudColor, SIGNAL(clicked()), this, SLOT(ColorButtonClicked()));
|
||||
connect(ui->gridLineColor, SIGNAL(clicked()), this, SLOT(ColorButtonClicked()));
|
||||
connect(ui->ViewSphereColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked()));
|
||||
|
@ -70,6 +71,7 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
|
|||
ui->lineWidth->setText(lcFormatValueLocalized(mOptions->Preferences.mLineWidth));
|
||||
ui->MeshLOD->setChecked(mOptions->Preferences.mAllowLOD);
|
||||
ui->FadeSteps->setChecked(mOptions->Preferences.mFadeSteps);
|
||||
ui->HighlightNewParts->setChecked(mOptions->Preferences.mHighlightNewParts);
|
||||
ui->gridStuds->setChecked(mOptions->Preferences.mDrawGridStuds);
|
||||
ui->gridLines->setChecked(mOptions->Preferences.mDrawGridLines);
|
||||
ui->gridLineSpacing->setText(QString::number(mOptions->Preferences.mGridLineSpacing));
|
||||
|
@ -110,6 +112,9 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
|
|||
|
||||
QPixmap pix(12, 12);
|
||||
|
||||
pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mHighlightNewPartsColor), LC_RGBA_GREEN(mOptions->Preferences.mHighlightNewPartsColor), LC_RGBA_BLUE(mOptions->Preferences.mHighlightNewPartsColor)));
|
||||
ui->HighlightNewPartsColor->setIcon(pix);
|
||||
|
||||
pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mGridStudColor), LC_RGBA_GREEN(mOptions->Preferences.mGridStudColor), LC_RGBA_BLUE(mOptions->Preferences.mGridStudColor)));
|
||||
ui->gridStudColor->setIcon(pix);
|
||||
|
||||
|
@ -128,6 +133,7 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
|
|||
on_studLogo_toggled();
|
||||
on_antiAliasing_toggled();
|
||||
on_edgeLines_toggled();
|
||||
on_HighlightNewParts_toggled();
|
||||
on_gridStuds_toggled();
|
||||
on_gridLines_toggled();
|
||||
on_ViewSphereSizeCombo_currentIndexChanged(ui->ViewSphereSizeCombo->currentIndex());
|
||||
|
@ -197,6 +203,7 @@ void lcQPreferencesDialog::accept()
|
|||
mOptions->Preferences.mLineWidth = lcParseValueLocalized(ui->lineWidth->text());
|
||||
mOptions->Preferences.mAllowLOD = ui->MeshLOD->isChecked();
|
||||
mOptions->Preferences.mFadeSteps = ui->FadeSteps->isChecked();
|
||||
mOptions->Preferences.mHighlightNewParts = ui->HighlightNewParts->isChecked();
|
||||
|
||||
mOptions->Preferences.mDrawGridStuds = ui->gridStuds->isChecked();
|
||||
mOptions->Preferences.mDrawGridLines = ui->gridLines->isChecked();
|
||||
|
@ -287,56 +294,62 @@ void lcQPreferencesDialog::on_lgeoPathBrowse_clicked()
|
|||
|
||||
void lcQPreferencesDialog::ColorButtonClicked()
|
||||
{
|
||||
QObject *button = sender();
|
||||
QString title;
|
||||
quint32 *color = nullptr;
|
||||
QColorDialog::ColorDialogOptions dialogOptions;
|
||||
QObject* Button = sender();
|
||||
QString Title;
|
||||
quint32* Color = nullptr;
|
||||
QColorDialog::ColorDialogOptions DialogOptions;
|
||||
|
||||
if (button == ui->gridStudColor)
|
||||
if (Button == ui->HighlightNewPartsColor)
|
||||
{
|
||||
color = &mOptions->Preferences.mGridStudColor;
|
||||
title = tr("Select Grid Stud Color");
|
||||
dialogOptions = QColorDialog::ShowAlphaChannel;
|
||||
Color = &mOptions->Preferences.mHighlightNewPartsColor;
|
||||
Title = tr("Select Highlight Color");
|
||||
DialogOptions = QColorDialog::ShowAlphaChannel;
|
||||
}
|
||||
else if (button == ui->gridLineColor)
|
||||
else if (Button == ui->gridStudColor)
|
||||
{
|
||||
color = &mOptions->Preferences.mGridLineColor;
|
||||
title = tr("Select Grid Line Color");
|
||||
dialogOptions = 0;
|
||||
Color = &mOptions->Preferences.mGridStudColor;
|
||||
Title = tr("Select Grid Stud Color");
|
||||
DialogOptions = QColorDialog::ShowAlphaChannel;
|
||||
}
|
||||
else if (button == ui->ViewSphereColorButton)
|
||||
else if (Button == ui->gridLineColor)
|
||||
{
|
||||
color = &mOptions->Preferences.mViewSphereColor;
|
||||
title = tr("Select View Sphere Color");
|
||||
dialogOptions = 0;
|
||||
Color = &mOptions->Preferences.mGridLineColor;
|
||||
Title = tr("Select Grid Line Color");
|
||||
DialogOptions = 0;
|
||||
}
|
||||
else if (button == ui->ViewSphereTextColorButton)
|
||||
else if (Button == ui->ViewSphereColorButton)
|
||||
{
|
||||
color = &mOptions->Preferences.mViewSphereTextColor;
|
||||
title = tr("Select View Sphere Text Color");
|
||||
dialogOptions = 0;
|
||||
Color = &mOptions->Preferences.mViewSphereColor;
|
||||
Title = tr("Select View Sphere Color");
|
||||
DialogOptions = 0;
|
||||
}
|
||||
else if (button == ui->ViewSphereHighlightColorButton)
|
||||
else if (Button == ui->ViewSphereTextColorButton)
|
||||
{
|
||||
color = &mOptions->Preferences.mViewSphereHighlightColor;
|
||||
title = tr("Select View Sphere Highlight Color");
|
||||
dialogOptions = 0;
|
||||
Color = &mOptions->Preferences.mViewSphereTextColor;
|
||||
Title = tr("Select View Sphere Text Color");
|
||||
DialogOptions = 0;
|
||||
}
|
||||
else if (Button == ui->ViewSphereHighlightColorButton)
|
||||
{
|
||||
Color = &mOptions->Preferences.mViewSphereHighlightColor;
|
||||
Title = tr("Select View Sphere Highlight Color");
|
||||
DialogOptions = 0;
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
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);
|
||||
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);
|
||||
|
||||
if (newColor == oldColor || !newColor.isValid())
|
||||
return;
|
||||
|
||||
*color = LC_RGBA(newColor.red(), newColor.green(), newColor.blue(), newColor.alpha());
|
||||
*Color = LC_RGBA(newColor.red(), newColor.green(), newColor.blue(), newColor.alpha());
|
||||
|
||||
QPixmap pix(12, 12);
|
||||
|
||||
pix.fill(newColor);
|
||||
((QToolButton*)button)->setIcon(pix);
|
||||
((QToolButton*)Button)->setIcon(pix);
|
||||
}
|
||||
|
||||
void lcQPreferencesDialog::on_studLogo_toggled()
|
||||
|
@ -354,6 +367,11 @@ void lcQPreferencesDialog::on_edgeLines_toggled()
|
|||
ui->lineWidth->setEnabled(ui->edgeLines->isChecked());
|
||||
}
|
||||
|
||||
void lcQPreferencesDialog::on_HighlightNewParts_toggled()
|
||||
{
|
||||
ui->HighlightNewPartsColor->setEnabled(ui->HighlightNewParts->isChecked());
|
||||
}
|
||||
|
||||
void lcQPreferencesDialog::on_gridStuds_toggled()
|
||||
{
|
||||
ui->gridStudColor->setEnabled(ui->gridStuds->isChecked());
|
||||
|
|
|
@ -35,6 +35,7 @@ public slots:
|
|||
void ColorButtonClicked();
|
||||
void on_antiAliasing_toggled();
|
||||
void on_edgeLines_toggled();
|
||||
void on_HighlightNewParts_toggled();
|
||||
void on_gridStuds_toggled();
|
||||
void on_gridLines_toggled();
|
||||
void on_ViewSphereSizeCombo_currentIndexChanged(int Index);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>598</width>
|
||||
<height>477</height>
|
||||
<height>489</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -304,23 +304,6 @@
|
|||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>width</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="lineWidth">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="antiAliasingSamples">
|
||||
<item>
|
||||
|
@ -340,21 +323,31 @@
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Shading Mode:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="axisIcon">
|
||||
<item row="2" column="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Axis icon</string>
|
||||
<string>width</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1" colspan="2">
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="lineWidth">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="ShadingMode">
|
||||
<item>
|
||||
<property name="text">
|
||||
|
@ -380,13 +373,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="studLogo">
|
||||
<property name="text">
|
||||
<string>Stud Logo</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="studLogoCombo">
|
||||
<item>
|
||||
|
@ -416,6 +402,20 @@
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="studLogo">
|
||||
<property name="text">
|
||||
<string>Stud Logo</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="axisIcon">
|
||||
<property name="text">
|
||||
<string>Axis icon</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
|
@ -436,6 +436,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="FadeSteps">
|
||||
<property name="text">
|
||||
<string>Fade Previous Steps</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="MeshLOD">
|
||||
<property name="text">
|
||||
|
@ -443,12 +450,36 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="FadeSteps">
|
||||
<property name="text">
|
||||
<string>Fade Previous Steps</string>
|
||||
</property>
|
||||
</widget>
|
||||
<item row="7" column="0" colspan="4">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="HighlightNewParts">
|
||||
<property name="text">
|
||||
<string>Highlight new parts</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="HighlightNewPartsColor">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
@ -1198,6 +1229,8 @@
|
|||
<tabstop>MeshLOD</tabstop>
|
||||
<tabstop>axisIcon</tabstop>
|
||||
<tabstop>FadeSteps</tabstop>
|
||||
<tabstop>HighlightNewParts</tabstop>
|
||||
<tabstop>HighlightNewPartsColor</tabstop>
|
||||
<tabstop>ShadingMode</tabstop>
|
||||
<tabstop>gridStuds</tabstop>
|
||||
<tabstop>gridStudColor</tabstop>
|
||||
|
|
Loading…
Reference in a new issue