mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
Remove ReadOnlyTextField
and use a ``` UM.TextField { enabled: false } ``` instead CURA-8688
This commit is contained in:
parent
5f3b35b30d
commit
9f7581d4e8
2 changed files with 14 additions and 49 deletions
|
@ -148,32 +148,32 @@ Item
|
||||||
}
|
}
|
||||||
|
|
||||||
Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Display Name") }
|
Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Display Name") }
|
||||||
ReadOnlyTextField
|
Cura.TextField
|
||||||
{
|
{
|
||||||
id: displayNameTextField;
|
id: displayNameTextField;
|
||||||
width: informationPage.columnWidth;
|
width: informationPage.columnWidth;
|
||||||
text: properties.name;
|
text: properties.name;
|
||||||
readOnly: !base.editingEnabled;
|
enabled: base.editingEnabled;
|
||||||
onEditingFinished: base.updateMaterialDisplayName(properties.name, text)
|
onEditingFinished: base.updateMaterialDisplayName(properties.name, text)
|
||||||
}
|
}
|
||||||
|
|
||||||
Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Brand") }
|
Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Brand") }
|
||||||
ReadOnlyTextField
|
Cura.TextField
|
||||||
{
|
{
|
||||||
id: brandTextField;
|
id: brandTextField
|
||||||
width: informationPage.columnWidth;
|
width: informationPage.columnWidth
|
||||||
text: properties.brand;
|
text: properties.brand
|
||||||
readOnly: !base.editingEnabled;
|
enabled: base.editingEnabled
|
||||||
onEditingFinished: base.updateMaterialBrand(properties.brand, text)
|
onEditingFinished: base.updateMaterialBrand(properties.brand, text)
|
||||||
}
|
}
|
||||||
|
|
||||||
Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Material Type") }
|
Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Material Type") }
|
||||||
ReadOnlyTextField
|
Cura.TextField
|
||||||
{
|
{
|
||||||
id: materialTypeField;
|
id: materialTypeField
|
||||||
width: informationPage.columnWidth;
|
width: informationPage.columnWidth
|
||||||
text: properties.material;
|
text: properties.material
|
||||||
readOnly: !base.editingEnabled;
|
enabled: base.editingEnabled
|
||||||
onEditingFinished: base.updateMaterialType(properties.material, text)
|
onEditingFinished: base.updateMaterialType(properties.material, text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,12 +206,12 @@ Item
|
||||||
}
|
}
|
||||||
|
|
||||||
// pretty color name text field
|
// pretty color name text field
|
||||||
ReadOnlyTextField
|
Cura.TextField
|
||||||
{
|
{
|
||||||
id: colorLabel;
|
id: colorLabel;
|
||||||
width: parent.width - colorSelector.width - parent.spacing
|
width: parent.width - colorSelector.width - parent.spacing
|
||||||
text: properties.color_name;
|
text: properties.color_name;
|
||||||
readOnly: !base.editingEnabled
|
enabled: base.editingEnabled
|
||||||
onEditingFinished: base.setMetaDataEntry("color_name", properties.color_name, text)
|
onEditingFinished: base.setMetaDataEntry("color_name", properties.color_name, text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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()
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue