forked from qt-creator/qt-creator
QmlDesigner: Fix material name editing issues
Material name field in material browser now ensures that the start of the string is visible when editing is not focused. Any click outside the name field will take the focus away from the field, and name field state is properly updated when focus goes away for any reason. Trying to set same name as before is ignored instead of changing the name to <oldName>1. Fixes: QDS-8185 Change-Id: I723e3ae312e3e2c4ce8a95a3b05effcee2bae328 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -998,6 +998,10 @@ void MaterialEditorView::renameMaterial(ModelNode &material, const QString &newN
|
||||
{
|
||||
QTC_ASSERT(material.isValid(), return);
|
||||
|
||||
QVariant objName = material.variantProperty("objectName").value();
|
||||
if (objName.isValid() && objName.toString() == newName)
|
||||
return;
|
||||
|
||||
executeInTransaction("MaterialEditorView:renameMaterial", [&] {
|
||||
material.setIdWithRefactoring(model()->generateIdFromName(newName, "material"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user