mirror of
https://github.com/leozide/leocad
synced 2025-01-30 20:34:56 +01:00
Configurable fade color.
This commit is contained in:
parent
acd7dd3f9a
commit
a5fde91ee9
13 changed files with 138 additions and 135 deletions
|
@ -22,6 +22,7 @@ void lcPreferences::LoadDefaults()
|
||||||
mLineWidth = lcGetProfileFloat(LC_PROFILE_LINE_WIDTH);
|
mLineWidth = lcGetProfileFloat(LC_PROFILE_LINE_WIDTH);
|
||||||
mAllowLOD = lcGetProfileInt(LC_PROFILE_ALLOW_LOD);
|
mAllowLOD = lcGetProfileInt(LC_PROFILE_ALLOW_LOD);
|
||||||
mFadeSteps = lcGetProfileInt(LC_PROFILE_FADE_STEPS);
|
mFadeSteps = lcGetProfileInt(LC_PROFILE_FADE_STEPS);
|
||||||
|
mFadeStepsColor = lcGetProfileInt(LC_PROFILE_FADE_STEPS_COLOR);
|
||||||
mHighlightNewParts = lcGetProfileInt(LC_PROFILE_HIGHLIGHT_NEW_PARTS);
|
mHighlightNewParts = lcGetProfileInt(LC_PROFILE_HIGHLIGHT_NEW_PARTS);
|
||||||
mHighlightNewPartsColor = lcGetProfileInt(LC_PROFILE_HIGHLIGHT_NEW_PARTS_COLOR);
|
mHighlightNewPartsColor = lcGetProfileInt(LC_PROFILE_HIGHLIGHT_NEW_PARTS_COLOR);
|
||||||
mDrawGridStuds = lcGetProfileInt(LC_PROFILE_GRID_STUDS);
|
mDrawGridStuds = lcGetProfileInt(LC_PROFILE_GRID_STUDS);
|
||||||
|
@ -49,6 +50,7 @@ void lcPreferences::SaveDefaults()
|
||||||
lcSetProfileFloat(LC_PROFILE_LINE_WIDTH, mLineWidth);
|
lcSetProfileFloat(LC_PROFILE_LINE_WIDTH, mLineWidth);
|
||||||
lcSetProfileInt(LC_PROFILE_ALLOW_LOD, mAllowLOD);
|
lcSetProfileInt(LC_PROFILE_ALLOW_LOD, mAllowLOD);
|
||||||
lcSetProfileInt(LC_PROFILE_FADE_STEPS, mFadeSteps);
|
lcSetProfileInt(LC_PROFILE_FADE_STEPS, mFadeSteps);
|
||||||
|
lcSetProfileInt(LC_PROFILE_FADE_STEPS_COLOR, mFadeStepsColor);
|
||||||
lcSetProfileInt(LC_PROFILE_HIGHLIGHT_NEW_PARTS, mHighlightNewParts);
|
lcSetProfileInt(LC_PROFILE_HIGHLIGHT_NEW_PARTS, mHighlightNewParts);
|
||||||
lcSetProfileInt(LC_PROFILE_HIGHLIGHT_NEW_PARTS_COLOR, mHighlightNewPartsColor);
|
lcSetProfileInt(LC_PROFILE_HIGHLIGHT_NEW_PARTS_COLOR, mHighlightNewPartsColor);
|
||||||
lcSetProfileInt(LC_PROFILE_GRID_STUDS, mDrawGridStuds);
|
lcSetProfileInt(LC_PROFILE_GRID_STUDS, mDrawGridStuds);
|
||||||
|
|
|
@ -34,6 +34,7 @@ public:
|
||||||
float mLineWidth;
|
float mLineWidth;
|
||||||
bool mAllowLOD;
|
bool mAllowLOD;
|
||||||
bool mFadeSteps;
|
bool mFadeSteps;
|
||||||
|
quint32 mFadeStepsColor;
|
||||||
bool mHighlightNewParts;
|
bool mHighlightNewParts;
|
||||||
quint32 mHighlightNewPartsColor;
|
quint32 mHighlightNewPartsColor;
|
||||||
bool mDrawGridStuds;
|
bool mDrawGridStuds;
|
||||||
|
|
|
@ -13,13 +13,10 @@ lcVector4 gInterfaceColors[LC_NUM_INTERFACECOLORS] = // todo: make the colors co
|
||||||
{
|
{
|
||||||
lcVector4(0.898f, 0.298f, 0.400f, 1.000f), // LC_COLOR_SELECTED
|
lcVector4(0.898f, 0.298f, 0.400f, 1.000f), // LC_COLOR_SELECTED
|
||||||
lcVector4(0.400f, 0.298f, 0.898f, 1.000f), // LC_COLOR_FOCUSED
|
lcVector4(0.400f, 0.298f, 0.898f, 1.000f), // LC_COLOR_FOCUSED
|
||||||
lcVector4(0.800f, 0.800f, 0.800f, 1.000f), // LC_COLOR_DISABLED
|
|
||||||
lcVector4(0.500f, 0.500f, 0.500f, 0.500f), // LC_COLOR_DISABLED_TRANSLUCENT
|
|
||||||
lcVector4(0.500f, 0.800f, 0.500f, 1.000f), // LC_COLOR_CAMERA
|
lcVector4(0.500f, 0.800f, 0.500f, 1.000f), // LC_COLOR_CAMERA
|
||||||
lcVector4(0.500f, 0.800f, 0.500f, 1.000f), // LC_COLOR_LIGHT
|
lcVector4(0.500f, 0.800f, 0.500f, 1.000f), // LC_COLOR_LIGHT
|
||||||
lcVector4(0.500f, 0.800f, 0.500f, 0.500f), // LC_COLOR_CONTROL_POINT
|
lcVector4(0.500f, 0.800f, 0.500f, 0.500f), // LC_COLOR_CONTROL_POINT
|
||||||
lcVector4(0.400f, 0.298f, 0.898f, 0.500f), // LC_COLOR_CONTROL_POINT_FOCUSED
|
lcVector4(0.400f, 0.298f, 0.898f, 0.500f), // LC_COLOR_CONTROL_POINT_FOCUSED
|
||||||
lcVector4(0.098f, 0.898f, 0.500f, 1.000f) // LC_COLOR_HIGHLIGHT
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void GetToken(char*& Ptr, char* Token)
|
static void GetToken(char*& Ptr, char* Token)
|
||||||
|
|
|
@ -34,13 +34,10 @@ enum lcInterfaceColor
|
||||||
{
|
{
|
||||||
LC_COLOR_SELECTED,
|
LC_COLOR_SELECTED,
|
||||||
LC_COLOR_FOCUSED,
|
LC_COLOR_FOCUSED,
|
||||||
LC_COLOR_DISABLED,
|
|
||||||
LC_COLOR_DISABLED_TRANSLUCENT,
|
|
||||||
LC_COLOR_CAMERA,
|
LC_COLOR_CAMERA,
|
||||||
LC_COLOR_LIGHT,
|
LC_COLOR_LIGHT,
|
||||||
LC_COLOR_CONTROL_POINT,
|
LC_COLOR_CONTROL_POINT,
|
||||||
LC_COLOR_CONTROL_POINT_FOCUSED,
|
LC_COLOR_CONTROL_POINT_FOCUSED,
|
||||||
LC_COLOR_HIGHLIGHT,
|
|
||||||
LC_NUM_INTERFACECOLORS
|
LC_NUM_INTERFACECOLORS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -509,10 +509,11 @@ void lcContext::SetColorIndexTinted(int ColorIndex, lcInterfaceColor InterfaceCo
|
||||||
SetColor(lcVector4(Color, gColorList[ColorIndex].Value.w));
|
SetColor(lcVector4(Color, gColorList[ColorIndex].Value.w));
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcContext::SetColorIndexTintedAlpha(int ColorIndex, lcInterfaceColor InterfaceColor, float Weight)
|
void lcContext::SetColorIndexTinted(int ColorIndex, const lcVector4& Tint)
|
||||||
{
|
{
|
||||||
const lcVector3 Color(gColorList[ColorIndex].Value * Weight + gInterfaceColors[InterfaceColor] * (1.0f - Weight));
|
const float Weight = Tint.w;
|
||||||
SetColor(lcVector4(Color, gColorList[ColorIndex].Value.w * gInterfaceColors[InterfaceColor].w));
|
const lcVector3 Color(gColorList[ColorIndex].Value * Weight + Tint * (1.0f - Weight));
|
||||||
|
SetColor(lcVector4(Color, gColorList[ColorIndex].Value.w * Tint.w));
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcContext::SetEdgeColorIndex(int ColorIndex)
|
void lcContext::SetEdgeColorIndex(int ColorIndex)
|
||||||
|
@ -520,16 +521,11 @@ void lcContext::SetEdgeColorIndex(int ColorIndex)
|
||||||
SetColor(gColorList[ColorIndex].Edge);
|
SetColor(gColorList[ColorIndex].Edge);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcContext::SetEdgeColorIndexTinted(int ColorIndex, lcInterfaceColor InterfaceColor, float Weight)
|
void lcContext::SetEdgeColorIndexTinted(int ColorIndex, const lcVector4& Tint)
|
||||||
{
|
{
|
||||||
const lcVector3 Color(gColorList[ColorIndex].Edge * Weight + gInterfaceColors[InterfaceColor] * (1.0f - Weight));
|
const float Weight = Tint.w;
|
||||||
SetColor(lcVector4(Color, gColorList[ColorIndex].Edge.w));
|
const lcVector3 Color(gColorList[ColorIndex].Edge * Weight + Tint * (1.0f - Weight));
|
||||||
}
|
SetColor(lcVector4(Color, gColorList[ColorIndex].Edge.w * Tint.w));
|
||||||
|
|
||||||
void lcContext::SetEdgeColorIndexTintedAlpha(int ColorIndex, lcInterfaceColor InterfaceColor, float Weight)
|
|
||||||
{
|
|
||||||
const lcVector3 Color(gColorList[ColorIndex].Edge * Weight + gInterfaceColors[InterfaceColor] * (1.0f - Weight));
|
|
||||||
SetColor(lcVector4(Color, gColorList[ColorIndex].Edge.w * gInterfaceColors[InterfaceColor].w));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcContext::SetInterfaceColor(lcInterfaceColor InterfaceColor)
|
void lcContext::SetInterfaceColor(lcInterfaceColor InterfaceColor)
|
||||||
|
|
|
@ -174,10 +174,9 @@ public:
|
||||||
void SetColor(float Red, float Green, float Blue, float Alpha);
|
void SetColor(float Red, float Green, float Blue, float Alpha);
|
||||||
void SetColorIndex(int ColorIndex);
|
void SetColorIndex(int ColorIndex);
|
||||||
void SetColorIndexTinted(int ColorIndex, lcInterfaceColor InterfaceColor, float Weight);
|
void SetColorIndexTinted(int ColorIndex, lcInterfaceColor InterfaceColor, float Weight);
|
||||||
void SetColorIndexTintedAlpha(int ColorIndex, lcInterfaceColor InterfaceColor, float Weight);
|
void SetColorIndexTinted(int ColorIndex, const lcVector4& Tint);
|
||||||
void SetEdgeColorIndex(int ColorIndex);
|
void SetEdgeColorIndex(int ColorIndex);
|
||||||
void SetEdgeColorIndexTinted(int ColorIndex, lcInterfaceColor InterfaceColor, float Weight);
|
void SetEdgeColorIndexTinted(int ColorIndex, const lcVector4& Tint);
|
||||||
void SetEdgeColorIndexTintedAlpha(int ColorIndex, lcInterfaceColor InterfaceColor, float Weight);
|
|
||||||
void SetInterfaceColor(lcInterfaceColor InterfaceColor);
|
void SetInterfaceColor(lcInterfaceColor InterfaceColor);
|
||||||
|
|
||||||
void ClearFramebuffer();
|
void ClearFramebuffer();
|
||||||
|
|
|
@ -59,6 +59,7 @@ static lcProfileEntry gProfileEntries[LC_NUM_PROFILE_KEYS] =
|
||||||
lcProfileEntry("Settings", "LineWidth", 1.0f), // LC_PROFILE_LINE_WIDTH
|
lcProfileEntry("Settings", "LineWidth", 1.0f), // LC_PROFILE_LINE_WIDTH
|
||||||
lcProfileEntry("Settings", "AllowLOD", true), // LC_PROFILE_ALLOW_LOD
|
lcProfileEntry("Settings", "AllowLOD", true), // LC_PROFILE_ALLOW_LOD
|
||||||
lcProfileEntry("Settings", "FadeSteps", false), // LC_PROFILE_FADE_STEPS
|
lcProfileEntry("Settings", "FadeSteps", false), // LC_PROFILE_FADE_STEPS
|
||||||
|
lcProfileEntry("Settings", "FadeStepsColor", LC_RGBA(128, 128, 128, 128)), // LC_PROFILE_FADE_STEPS_COLOR
|
||||||
lcProfileEntry("Settings", "HighlightNewParts", 0), // LC_PROFILE_HIGHLIGHT_NEW_PARTS
|
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", "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", "ShadingMode", static_cast<int>(lcShadingMode::DefaultLights)), // LC_PROFILE_SHADING_MODE
|
||||||
|
|
|
@ -7,6 +7,7 @@ enum LC_PROFILE_KEY
|
||||||
LC_PROFILE_LINE_WIDTH,
|
LC_PROFILE_LINE_WIDTH,
|
||||||
LC_PROFILE_ALLOW_LOD,
|
LC_PROFILE_ALLOW_LOD,
|
||||||
LC_PROFILE_FADE_STEPS,
|
LC_PROFILE_FADE_STEPS,
|
||||||
|
LC_PROFILE_FADE_STEPS_COLOR,
|
||||||
LC_PROFILE_HIGHLIGHT_NEW_PARTS,
|
LC_PROFILE_HIGHLIGHT_NEW_PARTS,
|
||||||
LC_PROFILE_HIGHLIGHT_NEW_PARTS_COLOR,
|
LC_PROFILE_HIGHLIGHT_NEW_PARTS_COLOR,
|
||||||
LC_PROFILE_SHADING_MODE,
|
LC_PROFILE_SHADING_MODE,
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
#include "lc_application.h"
|
#include "lc_application.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
|
|
||||||
bool gTranslucentFade = true; // todo: move to preferences
|
|
||||||
|
|
||||||
lcScene::lcScene()
|
lcScene::lcScene()
|
||||||
: mRenderMeshes(0, 1024), mOpaqueMeshes(0, 1024), mTranslucentMeshes(0, 1024), mInterfaceObjects(0, 1024)
|
: mRenderMeshes(0, 1024), mOpaqueMeshes(0, 1024), mTranslucentMeshes(0, 1024), mInterfaceObjects(0, 1024)
|
||||||
{
|
{
|
||||||
|
@ -24,12 +22,17 @@ void lcScene::Begin(const lcMatrix44& ViewMatrix)
|
||||||
{
|
{
|
||||||
mViewMatrix = ViewMatrix;
|
mViewMatrix = ViewMatrix;
|
||||||
mActiveSubmodelInstance = nullptr;
|
mActiveSubmodelInstance = nullptr;
|
||||||
mHasFadedParts = false;
|
|
||||||
mPreTranslucentCallback = nullptr;
|
mPreTranslucentCallback = nullptr;
|
||||||
mRenderMeshes.RemoveAll();
|
mRenderMeshes.RemoveAll();
|
||||||
mOpaqueMeshes.RemoveAll();
|
mOpaqueMeshes.RemoveAll();
|
||||||
mTranslucentMeshes.RemoveAll();
|
mTranslucentMeshes.RemoveAll();
|
||||||
mInterfaceObjects.RemoveAll();
|
mInterfaceObjects.RemoveAll();
|
||||||
|
|
||||||
|
const lcPreferences& Preferences = lcGetPreferences();
|
||||||
|
mHighlightColor = lcVector4FromColor(Preferences.mHighlightNewPartsColor);
|
||||||
|
mFadeColor = lcVector4FromColor(Preferences.mFadeStepsColor);
|
||||||
|
mHasFadedParts = false;
|
||||||
|
mTranslucentFade = mFadeColor.w != 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcScene::End()
|
void lcScene::End()
|
||||||
|
@ -69,7 +72,7 @@ void lcScene::AddMesh(lcMesh* Mesh, const lcMatrix44& WorldMatrix, int ColorInde
|
||||||
const float Distance = fabsf(lcMul31(WorldMatrix[3], mViewMatrix).z);
|
const float Distance = fabsf(lcMul31(WorldMatrix[3], mViewMatrix).z);
|
||||||
RenderMesh.LodIndex = mAllowLOD ? RenderMesh.Mesh->GetLodIndex(Distance) : LC_MESH_LOD_HIGH;
|
RenderMesh.LodIndex = mAllowLOD ? RenderMesh.Mesh->GetLodIndex(Distance) : LC_MESH_LOD_HIGH;
|
||||||
|
|
||||||
const bool ForceTranslucent = (gTranslucentFade && State == lcRenderMeshState::Faded);
|
const bool ForceTranslucent = (mTranslucentFade && State == lcRenderMeshState::Faded);
|
||||||
const bool Translucent = lcIsColorTranslucent(ColorIndex) || ForceTranslucent;
|
const bool Translucent = lcIsColorTranslucent(ColorIndex) || ForceTranslucent;
|
||||||
const lcMeshFlags Flags = Mesh->mFlags;
|
const lcMeshFlags Flags = Mesh->mFlags;
|
||||||
mHasFadedParts |= State == lcRenderMeshState::Faded;
|
mHasFadedParts |= State == lcRenderMeshState::Faded;
|
||||||
|
@ -192,9 +195,9 @@ void lcScene::DrawOpaqueMeshes(lcContext* Context, bool DrawLit, int PrimitiveTy
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case lcRenderMeshState::Faded:
|
case lcRenderMeshState::Faded:
|
||||||
if (gTranslucentFade)
|
if (mTranslucentFade)
|
||||||
continue;
|
continue;
|
||||||
Context->SetColorIndexTinted(ColorIndex, LC_COLOR_DISABLED, 0.25f);
|
Context->SetColorIndexTinted(ColorIndex, mFadeColor);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -218,14 +221,11 @@ void lcScene::DrawOpaqueMeshes(lcContext* Context, bool DrawLit, int PrimitiveTy
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case lcRenderMeshState::Highlighted:
|
case lcRenderMeshState::Highlighted:
|
||||||
Context->SetColor(lcVector4FromColor(lcGetPreferences().mHighlightNewPartsColor));
|
Context->SetColor(mHighlightColor);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case lcRenderMeshState::Faded:
|
case lcRenderMeshState::Faded:
|
||||||
if (gTranslucentFade)
|
Context->SetEdgeColorIndexTinted(ColorIndex, mFadeColor);
|
||||||
Context->SetEdgeColorIndexTintedAlpha(ColorIndex, LC_COLOR_DISABLED_TRANSLUCENT, 0.25f);
|
|
||||||
else
|
|
||||||
Context->SetEdgeColorIndexTinted(ColorIndex, LC_COLOR_DISABLED, 0.25f);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -370,10 +370,7 @@ void lcScene::DrawTranslucentMeshes(lcContext* Context, bool DrawLit, bool DrawF
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case lcRenderMeshState::Faded:
|
case lcRenderMeshState::Faded:
|
||||||
if (gTranslucentFade)
|
Context->SetColorIndexTinted(ColorIndex, mFadeColor);
|
||||||
Context->SetColorIndexTintedAlpha(ColorIndex, LC_COLOR_DISABLED_TRANSLUCENT, 0.25f);
|
|
||||||
else
|
|
||||||
Context->SetColorIndexTinted(ColorIndex, LC_COLOR_DISABLED, 0.25f);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,7 +449,7 @@ void lcScene::Draw(lcContext* Context) const
|
||||||
|
|
||||||
const int SolidPrimitiveTypes = LC_MESH_TRIANGLES | LC_MESH_TEXTURED_TRIANGLES;
|
const int SolidPrimitiveTypes = LC_MESH_TRIANGLES | LC_MESH_TEXTURED_TRIANGLES;
|
||||||
|
|
||||||
if (gTranslucentFade && mHasFadedParts)
|
if (mTranslucentFade && mHasFadedParts)
|
||||||
{
|
{
|
||||||
DrawOpaqueMeshes(Context, false, SolidPrimitiveTypes | LinePrimitiveTypes, false, true);
|
DrawOpaqueMeshes(Context, false, SolidPrimitiveTypes | LinePrimitiveTypes, false, true);
|
||||||
|
|
||||||
|
@ -485,7 +482,7 @@ void lcScene::Draw(lcContext* Context) const
|
||||||
if (DrawConditional)
|
if (DrawConditional)
|
||||||
LinePrimitiveTypes |= LC_MESH_CONDITIONAL_LINES;
|
LinePrimitiveTypes |= LC_MESH_CONDITIONAL_LINES;
|
||||||
|
|
||||||
if (gTranslucentFade && mHasFadedParts)
|
if (mTranslucentFade && mHasFadedParts)
|
||||||
{
|
{
|
||||||
DrawOpaqueMeshes(Context, true, LC_MESH_TRIANGLES | LC_MESH_TEXTURED_TRIANGLES, false, true);
|
DrawOpaqueMeshes(Context, true, LC_MESH_TRIANGLES | LC_MESH_TEXTURED_TRIANGLES, false, true);
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,11 @@ protected:
|
||||||
bool mDrawInterface;
|
bool mDrawInterface;
|
||||||
bool mAllowWireframe;
|
bool mAllowWireframe;
|
||||||
bool mAllowLOD;
|
bool mAllowLOD;
|
||||||
|
|
||||||
|
lcVector4 mFadeColor;
|
||||||
|
lcVector4 mHighlightColor;
|
||||||
bool mHasFadedParts;
|
bool mHasFadedParts;
|
||||||
|
bool mTranslucentFade;
|
||||||
|
|
||||||
std::function<void()> mPreTranslucentCallback;
|
std::function<void()> mPreTranslucentCallback;
|
||||||
lcArray<lcRenderMesh> mRenderMeshes;
|
lcArray<lcRenderMesh> mRenderMeshes;
|
||||||
|
|
|
@ -29,6 +29,7 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ui->lineWidth->setValidator(new QDoubleValidator(ui->lineWidth));
|
ui->lineWidth->setValidator(new QDoubleValidator(ui->lineWidth));
|
||||||
|
connect(ui->FadeStepsColor, SIGNAL(clicked()), this, SLOT(ColorButtonClicked()));
|
||||||
connect(ui->HighlightNewPartsColor, SIGNAL(clicked()), this, SLOT(ColorButtonClicked()));
|
connect(ui->HighlightNewPartsColor, SIGNAL(clicked()), this, SLOT(ColorButtonClicked()));
|
||||||
connect(ui->gridStudColor, SIGNAL(clicked()), this, SLOT(ColorButtonClicked()));
|
connect(ui->gridStudColor, SIGNAL(clicked()), this, SLOT(ColorButtonClicked()));
|
||||||
connect(ui->gridLineColor, SIGNAL(clicked()), this, SLOT(ColorButtonClicked()));
|
connect(ui->gridLineColor, SIGNAL(clicked()), this, SLOT(ColorButtonClicked()));
|
||||||
|
@ -112,6 +113,9 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
|
||||||
|
|
||||||
QPixmap pix(12, 12);
|
QPixmap pix(12, 12);
|
||||||
|
|
||||||
|
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)));
|
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);
|
ui->HighlightNewPartsColor->setIcon(pix);
|
||||||
|
|
||||||
|
@ -133,6 +137,7 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
|
||||||
on_studLogo_toggled();
|
on_studLogo_toggled();
|
||||||
on_antiAliasing_toggled();
|
on_antiAliasing_toggled();
|
||||||
on_edgeLines_toggled();
|
on_edgeLines_toggled();
|
||||||
|
on_FadeSteps_toggled();
|
||||||
on_HighlightNewParts_toggled();
|
on_HighlightNewParts_toggled();
|
||||||
on_gridStuds_toggled();
|
on_gridStuds_toggled();
|
||||||
on_gridLines_toggled();
|
on_gridLines_toggled();
|
||||||
|
@ -299,7 +304,13 @@ void lcQPreferencesDialog::ColorButtonClicked()
|
||||||
quint32* Color = nullptr;
|
quint32* Color = nullptr;
|
||||||
QColorDialog::ColorDialogOptions DialogOptions;
|
QColorDialog::ColorDialogOptions DialogOptions;
|
||||||
|
|
||||||
if (Button == ui->HighlightNewPartsColor)
|
if (Button == ui->FadeStepsColor)
|
||||||
|
{
|
||||||
|
Color = &mOptions->Preferences.mFadeStepsColor;
|
||||||
|
Title = tr("Select Fade Color");
|
||||||
|
DialogOptions = QColorDialog::ShowAlphaChannel;
|
||||||
|
}
|
||||||
|
else if (Button == ui->HighlightNewPartsColor)
|
||||||
{
|
{
|
||||||
Color = &mOptions->Preferences.mHighlightNewPartsColor;
|
Color = &mOptions->Preferences.mHighlightNewPartsColor;
|
||||||
Title = tr("Select Highlight Color");
|
Title = tr("Select Highlight Color");
|
||||||
|
@ -367,6 +378,11 @@ void lcQPreferencesDialog::on_edgeLines_toggled()
|
||||||
ui->lineWidth->setEnabled(ui->edgeLines->isChecked());
|
ui->lineWidth->setEnabled(ui->edgeLines->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void lcQPreferencesDialog::on_FadeSteps_toggled()
|
||||||
|
{
|
||||||
|
ui->FadeStepsColor->setEnabled(ui->FadeSteps->isChecked());
|
||||||
|
}
|
||||||
|
|
||||||
void lcQPreferencesDialog::on_HighlightNewParts_toggled()
|
void lcQPreferencesDialog::on_HighlightNewParts_toggled()
|
||||||
{
|
{
|
||||||
ui->HighlightNewPartsColor->setEnabled(ui->HighlightNewParts->isChecked());
|
ui->HighlightNewPartsColor->setEnabled(ui->HighlightNewParts->isChecked());
|
||||||
|
|
|
@ -35,6 +35,7 @@ public slots:
|
||||||
void ColorButtonClicked();
|
void ColorButtonClicked();
|
||||||
void on_antiAliasing_toggled();
|
void on_antiAliasing_toggled();
|
||||||
void on_edgeLines_toggled();
|
void on_edgeLines_toggled();
|
||||||
|
void on_FadeSteps_toggled();
|
||||||
void on_HighlightNewParts_toggled();
|
void on_HighlightNewParts_toggled();
|
||||||
void on_gridStuds_toggled();
|
void on_gridStuds_toggled();
|
||||||
void on_gridLines_toggled();
|
void on_gridLines_toggled();
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>598</width>
|
<width>598</width>
|
||||||
<height>489</height>
|
<height>492</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -304,6 +304,13 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" name="widget" native="true">
|
<widget class="QWidget" name="widget" native="true">
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QCheckBox" name="HighlightNewParts">
|
||||||
|
<property name="text">
|
||||||
|
<string>Highlight new parts</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QComboBox" name="antiAliasingSamples">
|
<widget class="QComboBox" name="antiAliasingSamples">
|
||||||
<item>
|
<item>
|
||||||
|
@ -323,53 +330,23 @@
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="0">
|
<item row="0" column="3">
|
||||||
<widget class="QLabel" name="label_3">
|
<spacer name="horizontalSpacer_2">
|
||||||
<property name="text">
|
<property name="orientation">
|
||||||
<string>Shading Mode:</string>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="sizeHint" stdset="0">
|
||||||
</item>
|
|
||||||
<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>
|
<size>
|
||||||
<width>75</width>
|
<width>40</width>
|
||||||
<height>16777215</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="1" colspan="2">
|
<item row="1" column="0">
|
||||||
<widget class="QComboBox" name="ShadingMode">
|
<widget class="QCheckBox" name="studLogo">
|
||||||
<item>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Wireframe</string>
|
<string>Stud Logo</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="0" column="0">
|
|
||||||
<widget class="QCheckBox" name="antiAliasing">
|
|
||||||
<property name="text">
|
|
||||||
<string>Anti-aliasing</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -402,33 +379,6 @@
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QCheckBox" name="edgeLines">
|
<widget class="QCheckBox" name="edgeLines">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -436,10 +386,20 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0" colspan="2">
|
<item row="2" column="1">
|
||||||
<widget class="QCheckBox" name="FadeSteps">
|
<widget class="QLineEdit" name="lineWidth">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>75</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QCheckBox" name="antiAliasing">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Fade Previous Steps</string>
|
<string>Anti-aliasing</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -450,36 +410,66 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0" colspan="4">
|
<item row="8" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<widget class="QLabel" name="label_3">
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="HighlightNewParts">
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Highlight new parts</string>
|
<string>Shading Mode:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="8" column="1" colspan="2">
|
||||||
|
<widget class="QComboBox" name="ShadingMode">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="HighlightNewPartsColor">
|
<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="2" column="2">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>width</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="5" column="0">
|
||||||
|
<widget class="QCheckBox" name="FadeSteps">
|
||||||
|
<property name="text">
|
||||||
|
<string>Fade previous steps</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="QToolButton" name="FadeStepsColor">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="6" column="1">
|
||||||
<spacer name="horizontalSpacer_9">
|
<widget class="QToolButton" name="HighlightNewPartsColor">
|
||||||
<property name="orientation">
|
<property name="text">
|
||||||
<enum>Qt::Horizontal</enum>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
</widget>
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -1229,6 +1219,7 @@
|
||||||
<tabstop>MeshLOD</tabstop>
|
<tabstop>MeshLOD</tabstop>
|
||||||
<tabstop>axisIcon</tabstop>
|
<tabstop>axisIcon</tabstop>
|
||||||
<tabstop>FadeSteps</tabstop>
|
<tabstop>FadeSteps</tabstop>
|
||||||
|
<tabstop>FadeStepsColor</tabstop>
|
||||||
<tabstop>HighlightNewParts</tabstop>
|
<tabstop>HighlightNewParts</tabstop>
|
||||||
<tabstop>HighlightNewPartsColor</tabstop>
|
<tabstop>HighlightNewPartsColor</tabstop>
|
||||||
<tabstop>ShadingMode</tabstop>
|
<tabstop>ShadingMode</tabstop>
|
||||||
|
|
Loading…
Add table
Reference in a new issue