mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 15:13:56 -06:00
Use Cura.Textfield in readonlyTextfield
Less code duplication, which is always good CURA-8685
This commit is contained in:
parent
d7758c0ee9
commit
eb7ab657fe
1 changed files with 2 additions and 8 deletions
|
@ -5,6 +5,7 @@
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import QtQuick.Controls 2.1
|
import QtQuick.Controls 2.1
|
||||||
import UM 1.5 as UM
|
import UM 1.5 as UM
|
||||||
|
import Cura 1.0 as Cura
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
|
@ -19,23 +20,16 @@ Item
|
||||||
width: textField.width
|
width: textField.width
|
||||||
height: textField.height
|
height: textField.height
|
||||||
|
|
||||||
TextField
|
Cura.TextField
|
||||||
{
|
{
|
||||||
id: textField
|
id: textField
|
||||||
|
|
||||||
enabled: !base.readOnly
|
enabled: !base.readOnly
|
||||||
|
|
||||||
color: UM.Theme.getColor("text")
|
|
||||||
font: UM.Theme.getFont("default")
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
onEditingFinished: base.editingFinished()
|
onEditingFinished: base.editingFinished()
|
||||||
Keys.onEnterPressed: base.editingFinished()
|
Keys.onEnterPressed: base.editingFinished()
|
||||||
Keys.onReturnPressed: base.editingFinished()
|
Keys.onReturnPressed: base.editingFinished()
|
||||||
background: Rectangle
|
|
||||||
{
|
|
||||||
radius: UM.Theme.getSize("setting_control_radius").width
|
|
||||||
color: textField.enabled ? UM.Theme.getColor("setting_control") : UM.Theme.getColor("setting_control_disabled")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue