Remove ReadOnlyTextField

and use a
```
UM.TextField
{
   enabled: false
}
```
instead

CURA-8688
This commit is contained in:
casper 2022-02-18 08:57:38 +01:00
parent 5f3b35b30d
commit 9f7581d4e8
2 changed files with 14 additions and 49 deletions

View file

@ -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)
}

View file

@ -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()
}
}