diff --git a/src/Gui/DlgMaterialProperties.ui b/src/Gui/DlgMaterialProperties.ui
index f0b56befd4..3f2b1835e3 100644
--- a/src/Gui/DlgMaterialProperties.ui
+++ b/src/Gui/DlgMaterialProperties.ui
@@ -7,7 +7,7 @@
0
0
292
- 247
+ 296
@@ -41,58 +41,6 @@
6
- -
-
-
- 6
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
- Shininess:
-
-
-
- -
-
-
- Qt::Horizontal
-
-
- QSizePolicy::Expanding
-
-
-
- 81
- 31
-
-
-
-
- -
-
-
- %
-
-
- 5
-
-
-
-
-
-
@@ -100,31 +48,27 @@
+ -
+
+
+ Shininess:
+
+
+
-
-
-
- -
-
-
-
+
+ true
- -
-
+
-
+
- Specular color:
-
-
-
- -
-
-
-
+ Reset
@@ -135,11 +79,67 @@
+ -
+
+
+
+ 122
+ 0
+
+
+
+ %
+
+
+ 100
+
+
+ 5
+
+
+
+ -
+
+
+
+
+
+ true
+
+
+
+ -
+
+
+ Specular color:
+
+
+
-
+
+ true
+
+
+
+ -
+
+
+ Default
+
+
+
+ -
+
+
+
+
+
+ true
+
-
@@ -150,16 +150,25 @@
-
-
+
- Reset
+ Transparency:
-
-
-
- Default
+
+
+
+ 122
+ 0
+
+
+
+ %
+
+
+ 100
@@ -188,7 +197,6 @@
diffuseColor
emissiveColor
specularColor
- shininess
diff --git a/src/Gui/DlgMaterialPropertiesImp.cpp b/src/Gui/DlgMaterialPropertiesImp.cpp
index a8451d940c..77defe6836 100644
--- a/src/Gui/DlgMaterialPropertiesImp.cpp
+++ b/src/Gui/DlgMaterialPropertiesImp.cpp
@@ -62,6 +62,8 @@ void DlgMaterialPropertiesImp::setupConnections()
this, &DlgMaterialPropertiesImp::onSpecularColorChanged);
connect(ui->shininess, qOverload(&QSpinBox::valueChanged),
this, &DlgMaterialPropertiesImp::onShininessValueChanged);
+ connect(ui->transparency, qOverload(&QSpinBox::valueChanged),
+ this, &DlgMaterialPropertiesImp::onTransparencyValueChanged);
connect(ui->buttonReset, &QPushButton::clicked,
this, &DlgMaterialPropertiesImp::onButtonReset);
connect(ui->buttonDefault, &QPushButton::clicked,
@@ -130,6 +132,14 @@ void DlgMaterialPropertiesImp::onShininessValueChanged(int sh)
customMaterial.shininess = (float)sh / 100.0F;
}
+/**
+ * Sets the current transparency.
+ */
+void DlgMaterialPropertiesImp::onTransparencyValueChanged(int sh)
+{
+ customMaterial.transparency = (float)sh / 100.0F;
+}
+
/**
* Reset the colors to the Coin3D defaults
*/
@@ -159,6 +169,9 @@ void DlgMaterialPropertiesImp::setButtonColors(const App::Material& mat)
ui->shininess->blockSignals(true);
ui->shininess->setValue((int)(100.0F * (mat.shininess + 0.001F)));
ui->shininess->blockSignals(false);
+ ui->transparency->blockSignals(true);
+ ui->transparency->setValue((int)(100.0F * (mat.transparency + 0.001F)));
+ ui->transparency->blockSignals(false);
}
#include "moc_DlgMaterialPropertiesImp.cpp"
diff --git a/src/Gui/DlgMaterialPropertiesImp.h b/src/Gui/DlgMaterialPropertiesImp.h
index c167aeac41..3b760c3196 100644
--- a/src/Gui/DlgMaterialPropertiesImp.h
+++ b/src/Gui/DlgMaterialPropertiesImp.h
@@ -63,6 +63,7 @@ private:
void onEmissiveColorChanged();
void onSpecularColorChanged();
void onShininessValueChanged(int);
+ void onTransparencyValueChanged(int);
void onButtonReset();
void onButtonDefault();
void setButtonColors(const App::Material& mat);
diff --git a/src/Mod/Material/Gui/DlgInspectAppearance.cpp b/src/Mod/Material/Gui/DlgInspectAppearance.cpp
index 0e8728f9e3..b7d02e0ba0 100644
--- a/src/Mod/Material/Gui/DlgInspectAppearance.cpp
+++ b/src/Mod/Material/Gui/DlgInspectAppearance.cpp
@@ -242,6 +242,16 @@ QWidget* DlgInspectAppearance::makeAppearanceTab(const App::Material& material)
grid->addWidget(labelShininess, row, 0);
grid->addWidget(editShininess, row, 1);
+ row += 1;
+
+ auto* labelTransparency = new QLabel();
+ labelTransparency->setText(tr("Transparency"));
+ auto* editTransparency = new QLineEdit();
+ editTransparency->setText(QString::number(material.transparency));
+ editTransparency->setEnabled(false);
+
+ grid->addWidget(labelTransparency, row, 0);
+ grid->addWidget(editTransparency, row, 1);
return tab;
}