From acd7dd3f9a00798a53141d97b13b7d6993fd43e7 Mon Sep 17 00:00:00 2001 From: Leonardo Zide Date: Sat, 25 Apr 2020 11:36:28 -0700 Subject: [PATCH] Allow highlight color to be set by the user. --- common/lc_application.cpp | 10 +++- common/lc_application.h | 2 + common/lc_mainwindow.cpp | 2 +- common/lc_model.cpp | 7 +-- common/lc_model.h | 4 +- common/lc_profile.cpp | 2 + common/lc_profile.h | 2 + common/lc_scene.cpp | 2 +- common/piece.cpp | 5 +- common/project.cpp | 7 +-- common/project.h | 2 - common/view.cpp | 3 +- common/view.h | 6 -- qt/lc_qhtmldialog.cpp | 2 - qt/lc_qhtmldialog.ui | 10 +--- qt/lc_qpreferencesdialog.cpp | 74 ++++++++++++++---------- qt/lc_qpreferencesdialog.h | 1 + qt/lc_qpreferencesdialog.ui | 105 +++++++++++++++++++++++------------ 18 files changed, 144 insertions(+), 102 deletions(-) diff --git a/common/lc_application.cpp b/common/lc_application.cpp index bf82a3e5..ef22459a 100644 --- a/common/lc_application.cpp +++ b/common/lc_application.cpp @@ -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>& 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>& 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) diff --git a/common/lc_application.h b/common/lc_application.h index 0d2de620..ea28acb8 100644 --- a/common/lc_application.h +++ b/common/lc_application.h @@ -34,6 +34,8 @@ public: float mLineWidth; bool mAllowLOD; bool mFadeSteps; + bool mHighlightNewParts; + quint32 mHighlightNewPartsColor; bool mDrawGridStuds; quint32 mGridStudColor; bool mDrawGridLines; diff --git a/common/lc_mainwindow.cpp b/common/lc_mainwindow.cpp index 702aacbd..5ecb55f5 100644 --- a/common/lc_mainwindow.cpp +++ b/common/lc_mainwindow.cpp @@ -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); diff --git a/common/lc_model.cpp b/common/lc_model.cpp index a83f8066..058a6d89 100644 --- a/common/lc_model.cpp +++ b/common/lc_model.cpp @@ -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())); diff --git a/common/lc_model.h b/common/lc_model.h index 8d4a9192..58e1bb17 100644 --- a/common/lc_model.h +++ b/common/lc_model.h @@ -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> GetPageLayouts(std::vector& AddedModels); void RayTest(lcObjectRayTest& ObjectRayTest) const; diff --git a/common/lc_profile.cpp b/common/lc_profile.cpp index 7c8f86fe..2ddd900b 100644 --- a/common/lc_profile.cpp +++ b/common/lc_profile.cpp @@ -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(lcShadingMode::DefaultLights)), // LC_PROFILE_SHADING_MODE lcProfileEntry("Settings", "DrawAxes", 0), // LC_PROFILE_DRAW_AXES lcProfileEntry("Settings", "DrawEdgeLines", 1), // LC_PROFILE_DRAW_EDGE_LINES diff --git a/common/lc_profile.h b/common/lc_profile.h index f50c495c..57df795a 100644 --- a/common/lc_profile.h +++ b/common/lc_profile.h @@ -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, diff --git a/common/lc_scene.cpp b/common/lc_scene.cpp index f02a765c..73145d4d 100644 --- a/common/lc_scene.cpp +++ b/common/lc_scene.cpp @@ -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: diff --git a/common/piece.cpp b/common/piece.cpp index 79ff3139..78b0aa5c 100644 --- a/common/piece.cpp +++ b/common/piece.cpp @@ -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); diff --git a/common/project.cpp b/common/project.cpp index 39a3f5b1..ce9e34c6 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -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 diff --git a/common/project.h b/common/project.h index 04c583be..836e10bb 100644 --- a/common/project.h +++ b/common/project.h @@ -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; }; diff --git a/common/view.cpp b/common/view.cpp index e6947043..f2c815d4 100644 --- a/common/view.cpp +++ b/common/view.cpp @@ -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) { diff --git a/common/view.h b/common/view.h index fbe9f4f5..9796a6e6 100644 --- a/common/view.h +++ b/common/view.h @@ -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 mRenderFramebuffer; lcViewSphere mViewSphere; diff --git a/qt/lc_qhtmldialog.cpp b/qt/lc_qhtmldialog.cpp index 3a225ed3..05a91986 100644 --- a/qt/lc_qhtmldialog.cpp +++ b/qt/lc_qhtmldialog.cpp @@ -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(); diff --git a/qt/lc_qhtmldialog.ui b/qt/lc_qhtmldialog.ui index f6fbb8ed..487a40b3 100644 --- a/qt/lc_qhtmldialog.ui +++ b/qt/lc_qhtmldialog.ui @@ -7,7 +7,7 @@ 0 0 400 - 612 + 460 @@ -163,13 +163,6 @@ - - - - Highlight new parts - - - @@ -220,7 +213,6 @@ indexPage stepWidth stepHeight - highlightNewParts partsAtTheEnd partsAfterEachStep diff --git a/qt/lc_qpreferencesdialog.cpp b/qt/lc_qpreferencesdialog.cpp index 325dd784..9a313cfe 100644 --- a/qt/lc_qpreferencesdialog.cpp +++ b/qt/lc_qpreferencesdialog.cpp @@ -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()); diff --git a/qt/lc_qpreferencesdialog.h b/qt/lc_qpreferencesdialog.h index 521dd6a5..f93a0170 100644 --- a/qt/lc_qpreferencesdialog.h +++ b/qt/lc_qpreferencesdialog.h @@ -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); diff --git a/qt/lc_qpreferencesdialog.ui b/qt/lc_qpreferencesdialog.ui index a541d30b..a5f8bc56 100644 --- a/qt/lc_qpreferencesdialog.ui +++ b/qt/lc_qpreferencesdialog.ui @@ -7,7 +7,7 @@ 0 0 598 - 477 + 489 @@ -304,23 +304,6 @@ - - - - width - - - - - - - - 75 - 16777215 - - - - @@ -340,21 +323,31 @@ - + Shading Mode: - - + + - Axis icon + width - + + + + + 75 + 16777215 + + + + + @@ -380,13 +373,6 @@ - - - - Stud Logo - - - @@ -416,6 +402,20 @@ + + + + Stud Logo + + + + + + + Axis icon + + + @@ -436,6 +436,13 @@ + + + + Fade Previous Steps + + + @@ -443,12 +450,36 @@ - - - - Fade Previous Steps - - + + + + + + Highlight new parts + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + @@ -1198,6 +1229,8 @@ MeshLOD axisIcon FadeSteps + HighlightNewParts + HighlightNewPartsColor ShadingMode gridStuds gridStudColor