mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 10:45:54 +08:00
Swap ReadOnlyTextfield to controls 2
CURA-8685
This commit is contained in:
parent
a20dac4c9b
commit
da96cb833c
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls 2.15
|
||||||
|
import UM 1.5 as UM
|
||||||
|
|
||||||
ScrollView
|
ScrollView
|
||||||
{
|
{
|
||||||
@ -26,7 +27,7 @@ ScrollView
|
|||||||
background: Rectangle
|
background: Rectangle
|
||||||
{
|
{
|
||||||
radius: UM.Theme.getSize("setting_control_radius").width
|
radius: UM.Theme.getSize("setting_control_radius").width
|
||||||
color: enabled ? UM.Theme.getColor("setting_control_disabled") : UM.Theme.getColor("setting_control")
|
color: textArea.enabled ? UM.Theme.getColor("setting_control") : UM.Theme.getColor("setting_control_disabled")
|
||||||
}
|
}
|
||||||
|
|
||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
// Different than the name suggests, it is not always read-only.
|
// Different than the name suggests, it is not always read-only.
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import QtQuick.Controls 1.1
|
import QtQuick.Controls 2.1
|
||||||
|
import UM 1.5 as UM
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
@ -23,26 +24,18 @@ Item
|
|||||||
id: textField
|
id: textField
|
||||||
|
|
||||||
enabled: !base.readOnly
|
enabled: !base.readOnly
|
||||||
opacity: base.readOnly ? 0.5 : 1.0
|
|
||||||
|
|
||||||
|
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")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
visible: base.readOnly
|
|
||||||
text: textField.text
|
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: textField.__panel ? textField.__panel.leftMargin : 0
|
|
||||||
|
|
||||||
color: palette.buttonText
|
|
||||||
}
|
|
||||||
|
|
||||||
SystemPalette { id: palette }
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user