diff --git a/common/lc_application.cpp b/common/lc_application.cpp index 3504ac4b..704bd5b0 100644 --- a/common/lc_application.cpp +++ b/common/lc_application.cpp @@ -25,6 +25,7 @@ void lcPreferences::LoadDefaults() mBackgroundGradientColorBottom = lcGetProfileInt(LC_PROFILE_GRADIENT_COLOR_BOTTOM); mDrawAxes = lcGetProfileInt(LC_PROFILE_DRAW_AXES); mAxesColor = lcGetProfileInt(LC_PROFILE_AXES_COLOR); + mTextColor = lcGetProfileInt(LC_PROFILE_TEXT_COLOR); mOverlayColor = lcGetProfileInt(LC_PROFILE_OVERLAY_COLOR); mActiveViewColor = lcGetProfileInt(LC_PROFILE_ACTIVE_VIEW_COLOR); mInactiveViewColor = lcGetProfileInt(LC_PROFILE_INACTIVE_VIEW_COLOR); @@ -63,6 +64,7 @@ void lcPreferences::SaveDefaults() lcSetProfileInt(LC_PROFILE_SHADING_MODE, static_cast(mShadingMode)); lcSetProfileInt(LC_PROFILE_DRAW_AXES, mDrawAxes); lcSetProfileInt(LC_PROFILE_AXES_COLOR, mAxesColor); + lcSetProfileInt(LC_PROFILE_TEXT_COLOR, mTextColor); lcSetProfileInt(LC_PROFILE_BACKGROUND_GRADIENT, mBackgroundGradient); lcSetProfileInt(LC_PROFILE_BACKGROUND_COLOR, mBackgroundSolidColor); lcSetProfileInt(LC_PROFILE_GRADIENT_COLOR_TOP, mBackgroundGradientColorTop); @@ -101,7 +103,8 @@ void lcPreferences::SetInterfaceColors(lcColorTheme ColorTheme) { if (ColorTheme == lcColorTheme::Dark) { - mAxesColor = LC_RGBA(0, 0, 0, 255); + mAxesColor = LC_RGBA(160, 160, 160, 255); + mTextColor = LC_RGBA(160, 160, 160, 255); mBackgroundSolidColor = LC_RGB(49, 52, 55); mBackgroundGradientColorTop = LC_RGB(0, 0, 191); mBackgroundGradientColorBottom = LC_RGB(255, 255, 255); @@ -116,6 +119,7 @@ void lcPreferences::SetInterfaceColors(lcColorTheme ColorTheme) else { mAxesColor = LC_RGBA(0, 0, 0, 255); + mTextColor = LC_RGBA(0, 0, 0, 255); mBackgroundSolidColor = LC_RGB(255, 255, 255); mBackgroundGradientColorTop = LC_RGB(54, 72, 95); mBackgroundGradientColorBottom = LC_RGB(49, 52, 55); diff --git a/common/lc_application.h b/common/lc_application.h index 731ee240..775306c1 100644 --- a/common/lc_application.h +++ b/common/lc_application.h @@ -35,6 +35,7 @@ public: quint32 mBackgroundGradientColorBottom; bool mDrawAxes; quint32 mAxesColor; + quint32 mTextColor; quint32 mOverlayColor; quint32 mActiveViewColor; quint32 mInactiveViewColor; diff --git a/common/lc_profile.cpp b/common/lc_profile.cpp index d452ef8d..956db787 100644 --- a/common/lc_profile.cpp +++ b/common/lc_profile.cpp @@ -71,6 +71,7 @@ static lcProfileEntry gProfileEntries[LC_NUM_PROFILE_KEYS] = lcProfileEntry("Settings", "GradientColorBottom", LC_RGB(49, 52, 55)), // LC_PROFILE_GRADIENT_COLOR_BOTTOM lcProfileEntry("Settings", "DrawAxes", 0), // LC_PROFILE_DRAW_AXES lcProfileEntry("Settings", "AxesColor", LC_RGBA(0, 0, 0, 255)), // LC_PROFILE_AXES_COLOR + lcProfileEntry("Settings", "TextColor", LC_RGBA(0, 0, 0, 255)), // LC_PROFILE_TEXT_COLOR lcProfileEntry("Settings", "OverlayColor", LC_RGBA(0, 0, 0, 255)), // LC_PROFILE_OVERLAY_COLOR lcProfileEntry("Settings", "ActiveViewColor", LC_RGBA(41, 128, 185, 255)), // LC_PROFILE_ACTIVE_VIEW_COLOR lcProfileEntry("Settings", "InactiveViewColor", LC_RGBA(69, 69, 69, 255)), // LC_PROFILE_INACTIVE_VIEW_COLOR diff --git a/common/lc_profile.h b/common/lc_profile.h index 31d9bbca..27916a05 100644 --- a/common/lc_profile.h +++ b/common/lc_profile.h @@ -18,6 +18,7 @@ enum LC_PROFILE_KEY LC_PROFILE_GRADIENT_COLOR_BOTTOM, LC_PROFILE_DRAW_AXES, LC_PROFILE_AXES_COLOR, + LC_PROFILE_TEXT_COLOR, LC_PROFILE_OVERLAY_COLOR, LC_PROFILE_ACTIVE_VIEW_COLOR, LC_PROFILE_INACTIVE_VIEW_COLOR, diff --git a/common/lc_view.cpp b/common/lc_view.cpp index 8ea99bd2..f2b73f58 100644 --- a/common/lc_view.cpp +++ b/common/lc_view.cpp @@ -1061,7 +1061,7 @@ void lcView::DrawViewport() const if (!CameraName.isEmpty()) { mContext->SetMaterial(lcMaterialType::UnlitTextureModulate); - mContext->SetColor(0.0f, 0.0f, 0.0f, 1.0f); + mContext->SetColor(lcVector4FromColor(lcGetPreferences().mTextColor)); mContext->BindTexture2D(gTexFont.GetTexture()); glEnable(GL_BLEND); diff --git a/qt/lc_qpreferencesdialog.cpp b/qt/lc_qpreferencesdialog.cpp index e109341c..39974076 100644 --- a/qt/lc_qpreferencesdialog.cpp +++ b/qt/lc_qpreferencesdialog.cpp @@ -31,6 +31,7 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO connect(ui->BackgroundGradient1ColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked())); connect(ui->BackgroundGradient2ColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked())); connect(ui->AxesColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked())); + connect(ui->TextColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked())); connect(ui->OverlayColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked())); connect(ui->FadeStepsColor, SIGNAL(clicked()), this, SLOT(ColorButtonClicked())); connect(ui->HighlightNewPartsColor, SIGNAL(clicked()), this, SLOT(ColorButtonClicked())); @@ -194,6 +195,9 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mAxesColor), LC_RGBA_GREEN(mOptions->Preferences.mAxesColor), LC_RGBA_BLUE(mOptions->Preferences.mAxesColor))); ui->AxesColorButton->setIcon(pix); + pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mTextColor), LC_RGBA_GREEN(mOptions->Preferences.mTextColor), LC_RGBA_BLUE(mOptions->Preferences.mTextColor))); + ui->TextColorButton->setIcon(pix); + pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mOverlayColor), LC_RGBA_GREEN(mOptions->Preferences.mOverlayColor), LC_RGBA_BLUE(mOptions->Preferences.mOverlayColor))); ui->OverlayColorButton->setIcon(pix); @@ -311,24 +315,19 @@ void lcQPreferencesDialog::accept() mOptions->Preferences.mBackgroundGradient = ui->BackgroundGradientRadio->isChecked(); mOptions->Preferences.mDrawAxes = ui->AxisIconCheckBox->isChecked(); + mOptions->Preferences.mViewSphereEnabled = ui->ViewSphereSizeCombo->currentIndex() > 0; mOptions->Preferences.mViewSphereLocation = (lcViewSphereLocation)ui->ViewSphereLocationCombo->currentIndex(); switch (ui->ViewSphereSizeCombo->currentIndex()) { case 3: mOptions->Preferences.mViewSphereSize = 200; - mOptions->Preferences.mViewSphereEnabled = 1; break; case 2: mOptions->Preferences.mViewSphereSize = 100; - mOptions->Preferences.mViewSphereEnabled = 1; break; case 1: mOptions->Preferences.mViewSphereSize = 50; - mOptions->Preferences.mViewSphereEnabled = 1; - break; - default: - mOptions->Preferences.mViewSphereEnabled = 0; break; } @@ -340,25 +339,19 @@ void lcQPreferencesDialog::accept() mOptions->StudLogo = 0; mOptions->Preferences.mDrawPreviewAxis = ui->PreviewAxisIconCheckBox->isChecked(); - + mOptions->Preferences.mPreviewViewSphereEnabled = ui->PreviewViewSphereSizeCombo->currentIndex() > 0; mOptions->Preferences.mPreviewViewSphereLocation = (lcViewSphereLocation)ui->PreviewViewSphereLocationCombo->currentIndex(); switch (ui->PreviewViewSphereSizeCombo->currentIndex()) { case 3: mOptions->Preferences.mPreviewViewSphereSize = 100; - mOptions->Preferences.mPreviewViewSphereEnabled = 1; break; case 2: mOptions->Preferences.mPreviewViewSphereSize = 75; - mOptions->Preferences.mPreviewViewSphereEnabled = 1; break; case 1: mOptions->Preferences.mPreviewViewSphereSize = 50; - mOptions->Preferences.mPreviewViewSphereEnabled = 1; - break; - default: - mOptions->Preferences.mPreviewViewSphereEnabled = 0; break; } @@ -454,6 +447,11 @@ void lcQPreferencesDialog::ColorButtonClicked() Color = &mOptions->Preferences.mAxesColor; Title = tr("Select Axes Color"); } + else if (Button == ui->TextColorButton) + { + Color = &mOptions->Preferences.mTextColor; + Title = tr("Select Text Color"); + } else if (Button == ui->OverlayColorButton) { Color = &mOptions->Preferences.mOverlayColor; diff --git a/qt/lc_qpreferencesdialog.ui b/qt/lc_qpreferencesdialog.ui index d000f795..7d26a46b 100644 --- a/qt/lc_qpreferencesdialog.ui +++ b/qt/lc_qpreferencesdialog.ui @@ -895,54 +895,20 @@ - Overlays + Interface - - - - - - - - - - - Axis Icon: - - - - + - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + + - Overlay Color: - - - - - - - Active View: + Axis Icon: @@ -967,6 +933,54 @@ + + + + Active View: + + + + + + + Text: + + + + + + + + + + + + + + Overlay Color: + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -1671,6 +1685,7 @@ BackgroundGradient2ColorButton ActiveViewColorButton InactiveViewColorButton + TextColorButton AxesColorButton OverlayColorButton gridLineColor