diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index ecb9870fcf..d71a6f398f 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -148,32 +148,32 @@ Item } Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Display Name") } - ReadOnlyTextField + Cura.TextField { id: displayNameTextField; width: informationPage.columnWidth; text: properties.name; - readOnly: !base.editingEnabled; + enabled: base.editingEnabled; onEditingFinished: base.updateMaterialDisplayName(properties.name, text) } Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Brand") } - ReadOnlyTextField + Cura.TextField { - id: brandTextField; - width: informationPage.columnWidth; - text: properties.brand; - readOnly: !base.editingEnabled; + id: brandTextField + width: informationPage.columnWidth + text: properties.brand + enabled: base.editingEnabled onEditingFinished: base.updateMaterialBrand(properties.brand, text) } Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Material Type") } - ReadOnlyTextField + Cura.TextField { - id: materialTypeField; - width: informationPage.columnWidth; - text: properties.material; - readOnly: !base.editingEnabled; + id: materialTypeField + width: informationPage.columnWidth + text: properties.material + enabled: base.editingEnabled onEditingFinished: base.updateMaterialType(properties.material, text) } @@ -206,12 +206,12 @@ Item } // pretty color name text field - ReadOnlyTextField + Cura.TextField { id: colorLabel; width: parent.width - colorSelector.width - parent.spacing text: properties.color_name; - readOnly: !base.editingEnabled + enabled: base.editingEnabled onEditingFinished: base.setMetaDataEntry("color_name", properties.color_name, text) } diff --git a/resources/qml/Preferences/ReadOnlyTextField.qml b/resources/qml/Preferences/ReadOnlyTextField.qml deleted file mode 100644 index 325081dd13..0000000000 --- a/resources/qml/Preferences/ReadOnlyTextField.qml +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2016 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. -// Different than the name suggests, it is not always read-only. - -import QtQuick 2.1 -import QtQuick.Controls 2.1 -import UM 1.5 as UM -import Cura 1.0 as Cura - -Item -{ - id: base - - property alias text: textField.text - - signal editingFinished() - - property bool readOnly: false - - width: textField.width - height: textField.height - - Cura.TextField - { - id: textField - - enabled: !base.readOnly - - anchors.fill: parent - - onEditingFinished: base.editingFinished() - Keys.onEnterPressed: base.editingFinished() - Keys.onReturnPressed: base.editingFinished() - } -}