mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-10 23:35:07 -06:00
Swap ReadOnlyTextfield to controls 2
CURA-8685
This commit is contained in:
parent
a20dac4c9b
commit
da96cb833c
2 changed files with 11 additions and 17 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 2.15
|
||||
import UM 1.5 as UM
|
||||
|
||||
ScrollView
|
||||
{
|
||||
|
@ -26,7 +27,7 @@ ScrollView
|
|||
background: Rectangle
|
||||
{
|
||||
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")
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
// Different than the name suggests, it is not always read-only.
|
||||
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls 2.1
|
||||
import UM 1.5 as UM
|
||||
|
||||
Item
|
||||
{
|
||||
|
@ -23,26 +24,18 @@ Item
|
|||
id: textField
|
||||
|
||||
enabled: !base.readOnly
|
||||
opacity: base.readOnly ? 0.5 : 1.0
|
||||
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("default")
|
||||
anchors.fill: parent
|
||||
|
||||
onEditingFinished: base.editingFinished()
|
||||
Keys.onEnterPressed: 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…
Add table
Add a link
Reference in a new issue