forked from qt-creator/qt-creator
QmlDesigner: Add PrincipledMaterialEx to QDS
Task-number: QDS-13226 Change-Id: I9313df343a92c5c2d55c4eba75e994b639fe7bb2 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -57,6 +57,11 @@ static bool containsTexture(const ModelNode &node)
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static bool showPrincipledMaterialEx()
|
||||||
|
{
|
||||||
|
return Core::ICore::settings()->value("QML/Designer/ShowPrincipledMaterialEx", false).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
MaterialEditorView::MaterialEditorView(ExternalDependenciesInterface &externalDependencies)
|
MaterialEditorView::MaterialEditorView(ExternalDependenciesInterface &externalDependencies)
|
||||||
: AbstractView{externalDependencies}
|
: AbstractView{externalDependencies}
|
||||||
, m_stackedWidget(new QStackedWidget)
|
, m_stackedWidget(new QStackedWidget)
|
||||||
@@ -719,13 +724,21 @@ void MaterialEditorView::updatePossibleTypes()
|
|||||||
if (!m_qmlBackEnd)
|
if (!m_qmlBackEnd)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
static const QStringList basicTypes {
|
static const QStringList basicTypes = []() {
|
||||||
|
QStringList types = {
|
||||||
"CustomMaterial",
|
"CustomMaterial",
|
||||||
"DefaultMaterial",
|
"DefaultMaterial",
|
||||||
"PrincipledMaterial",
|
"PrincipledMaterial",
|
||||||
"SpecularGlossyMaterial"
|
"PrincipledMaterialEx",
|
||||||
|
"SpecularGlossyMaterial",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!showPrincipledMaterialEx())
|
||||||
|
types.removeOne("PrincipledMaterialEx");
|
||||||
|
|
||||||
|
return types;
|
||||||
|
}();
|
||||||
|
|
||||||
const QString matType = m_selectedMaterial.simplifiedTypeName();
|
const QString matType = m_selectedMaterial.simplifiedTypeName();
|
||||||
|
|
||||||
if (basicTypes.contains(matType)) {
|
if (basicTypes.contains(matType)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user