diff --git a/common/lc_application.cpp b/common/lc_application.cpp index 6ed413fa..8af15304 100644 --- a/common/lc_application.cpp +++ b/common/lc_application.cpp @@ -26,6 +26,8 @@ void lcPreferences::LoadDefaults() mDrawAxes = lcGetProfileInt(LC_PROFILE_DRAW_AXES); mAxesColor = lcGetProfileInt(LC_PROFILE_AXES_COLOR); mTextColor = lcGetProfileInt(LC_PROFILE_TEXT_COLOR); + mMarqueeBorderColor = lcGetProfileInt(LC_PROFILE_MARQUEE_BORDER_COLOR); + mMarqueeFillColor = lcGetProfileInt(LC_PROFILE_MARQUEE_FILL_COLOR); mOverlayColor = lcGetProfileInt(LC_PROFILE_OVERLAY_COLOR); mActiveViewColor = lcGetProfileInt(LC_PROFILE_ACTIVE_VIEW_COLOR); mInactiveViewColor = lcGetProfileInt(LC_PROFILE_INACTIVE_VIEW_COLOR); @@ -69,6 +71,8 @@ void lcPreferences::SaveDefaults() lcSetProfileInt(LC_PROFILE_BACKGROUND_COLOR, mBackgroundSolidColor); lcSetProfileInt(LC_PROFILE_GRADIENT_COLOR_TOP, mBackgroundGradientColorTop); lcSetProfileInt(LC_PROFILE_GRADIENT_COLOR_BOTTOM, mBackgroundGradientColorBottom); + lcSetProfileInt(LC_PROFILE_MARQUEE_BORDER_COLOR, mMarqueeBorderColor); + lcSetProfileInt(LC_PROFILE_MARQUEE_FILL_COLOR, mMarqueeFillColor); lcSetProfileInt(LC_PROFILE_OVERLAY_COLOR, mOverlayColor); lcSetProfileInt(LC_PROFILE_ACTIVE_VIEW_COLOR, mActiveViewColor); lcSetProfileInt(LC_PROFILE_INACTIVE_VIEW_COLOR, mInactiveViewColor); diff --git a/common/lc_application.h b/common/lc_application.h index e05aa8ec..70058ee0 100644 --- a/common/lc_application.h +++ b/common/lc_application.h @@ -36,6 +36,8 @@ public: bool mDrawAxes; quint32 mAxesColor; quint32 mTextColor; + quint32 mMarqueeBorderColor; + quint32 mMarqueeFillColor; quint32 mOverlayColor; quint32 mActiveViewColor; quint32 mInactiveViewColor; diff --git a/common/lc_profile.cpp b/common/lc_profile.cpp index 956db787..5052d072 100644 --- a/common/lc_profile.cpp +++ b/common/lc_profile.cpp @@ -72,6 +72,8 @@ static lcProfileEntry gProfileEntries[LC_NUM_PROFILE_KEYS] = 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", "MarqueeBorderColor", LC_RGBA(64, 64, 255, 255)), // LC_PROFILE_MARQUEE_BORDER_COLOR + lcProfileEntry("Settings", "MarqueeFillColor", LC_RGBA(64, 64, 255, 64)), // LC_PROFILE_MARQUEE_FILL_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 27916a05..0af102f0 100644 --- a/common/lc_profile.h +++ b/common/lc_profile.h @@ -19,6 +19,8 @@ enum LC_PROFILE_KEY LC_PROFILE_DRAW_AXES, LC_PROFILE_AXES_COLOR, LC_PROFILE_TEXT_COLOR, + LC_PROFILE_MARQUEE_BORDER_COLOR, + LC_PROFILE_MARQUEE_FILL_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 f2b73f58..37a61257 100644 --- a/common/lc_view.cpp +++ b/common/lc_view.cpp @@ -1719,18 +1719,22 @@ void lcView::DrawSelectZoomRegionOverlay() { Right - BorderX, Top - BorderY }, }; - glEnable(GL_BLEND); - mContext->SetVertexBufferPointer(Verts); mContext->SetVertexFormatPosition(2); - mContext->SetColor(0.25f, 0.25f, 1.0f, 1.0f); + const lcPreferences& Preferences = lcGetPreferences(); + + mContext->SetColor(lcVector4FromColor(Preferences.mMarqueeBorderColor)); mContext->DrawPrimitives(GL_TRIANGLE_STRIP, 0, 10); - mContext->SetColor(0.25f, 0.25f, 1.0f, 0.25f); - mContext->DrawPrimitives(GL_TRIANGLE_STRIP, 10, 4); + if (LC_RGBA_ALPHA(Preferences.mMarqueeFillColor)) + { + glEnable(GL_BLEND); + mContext->SetColor(lcVector4FromColor(Preferences.mMarqueeFillColor)); + mContext->DrawPrimitives(GL_TRIANGLE_STRIP, 10, 4); + glDisable(GL_BLEND); + } - glDisable(GL_BLEND); glEnable(GL_DEPTH_TEST); } diff --git a/qt/lc_qpreferencesdialog.cpp b/qt/lc_qpreferencesdialog.cpp index 8c2dcf85..abb2a4fd 100644 --- a/qt/lc_qpreferencesdialog.cpp +++ b/qt/lc_qpreferencesdialog.cpp @@ -32,6 +32,8 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO 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->MarqueeBorderColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked())); + connect(ui->MarqueeFillColorButton, 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())); @@ -181,52 +183,31 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO ui->ShadingMode->removeItem(static_cast(lcShadingMode::DefaultLights)); ui->ShadingMode->setCurrentIndex(static_cast(mOptions->Preferences.mShadingMode)); - QPixmap pix(12, 12); + auto SetButtonPixmap = [](quint32 Color, QToolButton* Button) + { + QPixmap Pixmap(12, 12); - pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mBackgroundSolidColor), LC_RGBA_GREEN(mOptions->Preferences.mBackgroundSolidColor), LC_RGBA_BLUE(mOptions->Preferences.mBackgroundSolidColor))); - ui->BackgroundSolidColorButton->setIcon(pix); + Pixmap.fill(QColor(LC_RGBA_RED(Color), LC_RGBA_GREEN(Color), LC_RGBA_BLUE(Color))); + Button->setIcon(Pixmap); + }; - pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mBackgroundGradientColorTop), LC_RGBA_GREEN(mOptions->Preferences.mBackgroundGradientColorTop), LC_RGBA_BLUE(mOptions->Preferences.mBackgroundGradientColorTop))); - ui->BackgroundGradient1ColorButton->setIcon(pix); - - pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mBackgroundGradientColorBottom), LC_RGBA_GREEN(mOptions->Preferences.mBackgroundGradientColorBottom), LC_RGBA_BLUE(mOptions->Preferences.mBackgroundGradientColorBottom))); - ui->BackgroundGradient2ColorButton->setIcon(pix); - - 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); - - pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mActiveViewColor), LC_RGBA_GREEN(mOptions->Preferences.mActiveViewColor), LC_RGBA_BLUE(mOptions->Preferences.mActiveViewColor))); - ui->ActiveViewColorButton->setIcon(pix); - - pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mInactiveViewColor), LC_RGBA_GREEN(mOptions->Preferences.mInactiveViewColor), LC_RGBA_BLUE(mOptions->Preferences.mInactiveViewColor))); - ui->InactiveViewColorButton->setIcon(pix); - - pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mFadeStepsColor), LC_RGBA_GREEN(mOptions->Preferences.mFadeStepsColor), LC_RGBA_BLUE(mOptions->Preferences.mFadeStepsColor))); - ui->FadeStepsColor->setIcon(pix); - - 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); - - pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mGridLineColor), LC_RGBA_GREEN(mOptions->Preferences.mGridLineColor), LC_RGBA_BLUE(mOptions->Preferences.mGridLineColor))); - ui->gridLineColor->setIcon(pix); - - pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mViewSphereColor), LC_RGBA_GREEN(mOptions->Preferences.mViewSphereColor), LC_RGBA_BLUE(mOptions->Preferences.mViewSphereColor))); - ui->ViewSphereColorButton->setIcon(pix); - - pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mViewSphereTextColor), LC_RGBA_GREEN(mOptions->Preferences.mViewSphereTextColor), LC_RGBA_BLUE(mOptions->Preferences.mViewSphereTextColor))); - ui->ViewSphereTextColorButton->setIcon(pix); - - pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mViewSphereHighlightColor), LC_RGBA_GREEN(mOptions->Preferences.mViewSphereHighlightColor), LC_RGBA_BLUE(mOptions->Preferences.mViewSphereHighlightColor))); - ui->ViewSphereHighlightColorButton->setIcon(pix); + SetButtonPixmap(mOptions->Preferences.mBackgroundSolidColor, ui->BackgroundSolidColorButton); + SetButtonPixmap(mOptions->Preferences.mBackgroundGradientColorTop, ui->BackgroundGradient1ColorButton); + SetButtonPixmap(mOptions->Preferences.mBackgroundGradientColorBottom, ui->BackgroundGradient2ColorButton); + SetButtonPixmap(mOptions->Preferences.mAxesColor, ui->AxesColorButton); + SetButtonPixmap(mOptions->Preferences.mTextColor, ui->TextColorButton); + SetButtonPixmap(mOptions->Preferences.mMarqueeBorderColor, ui->MarqueeBorderColorButton); + SetButtonPixmap(mOptions->Preferences.mMarqueeFillColor, ui->MarqueeFillColorButton); + SetButtonPixmap(mOptions->Preferences.mOverlayColor, ui->OverlayColorButton); + SetButtonPixmap(mOptions->Preferences.mActiveViewColor, ui->ActiveViewColorButton); + SetButtonPixmap(mOptions->Preferences.mInactiveViewColor, ui->InactiveViewColorButton); + SetButtonPixmap(mOptions->Preferences.mFadeStepsColor, ui->FadeStepsColor); + SetButtonPixmap(mOptions->Preferences.mHighlightNewPartsColor, ui->HighlightNewPartsColor); + SetButtonPixmap(mOptions->Preferences.mGridStudColor, ui->gridStudColor); + SetButtonPixmap(mOptions->Preferences.mGridLineColor, ui->gridLineColor); + SetButtonPixmap(mOptions->Preferences.mViewSphereColor, ui->ViewSphereColorButton); + SetButtonPixmap(mOptions->Preferences.mViewSphereTextColor, ui->ViewSphereTextColorButton); + SetButtonPixmap(mOptions->Preferences.mViewSphereHighlightColor, ui->ViewSphereHighlightColorButton); on_studLogo_toggled(); on_antiAliasing_toggled(); @@ -452,6 +433,17 @@ void lcQPreferencesDialog::ColorButtonClicked() Color = &mOptions->Preferences.mTextColor; Title = tr("Select Text Color"); } + else if (Button == ui->MarqueeBorderColorButton) + { + Color = &mOptions->Preferences.mMarqueeBorderColor; + Title = tr("Select Marquee Border Color"); + } + else if (Button == ui->MarqueeFillColorButton) + { + Color = &mOptions->Preferences.mMarqueeFillColor; + Title = tr("Select Marquee Fill Color"); + DialogOptions = QColorDialog::ShowAlphaChannel; + } else if (Button == ui->OverlayColorButton) { Color = &mOptions->Preferences.mOverlayColor; @@ -518,6 +510,7 @@ void lcQPreferencesDialog::ColorButtonClicked() QPixmap pix(12, 12); + newColor.setAlpha(255); pix.fill(newColor); ((QToolButton*)Button)->setIcon(pix); } diff --git a/qt/lc_qpreferencesdialog.ui b/qt/lc_qpreferencesdialog.ui index 7d26a46b..de2432bb 100644 --- a/qt/lc_qpreferencesdialog.ui +++ b/qt/lc_qpreferencesdialog.ui @@ -898,17 +898,10 @@ Interface - - + + - - - - - - - - Axis Icon: + Inactive View Border: @@ -919,10 +912,24 @@ - - + + - Inactive View: + Overlay Color: + + + + + + + Active View Border: + + + + + + + @@ -933,38 +940,10 @@ - - - - Active View: - - - - + - Text: - - - - - - - - - - - - - - Overlay Color: - - - - - - - + Camera Name: @@ -981,6 +960,55 @@ + + + + + + + + + + + Axis Icon Labels: + + + + + + + + + + + + + + Marquee Border: + + + + + + + + + + + + + + Marquee Fill: + + + + + + + + + + @@ -1687,6 +1715,8 @@ InactiveViewColorButton TextColorButton AxesColorButton + MarqueeBorderColorButton + MarqueeFillColorButton OverlayColorButton gridLineColor gridStudColor