mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-21 21:58:01 -06:00
Use clearer styling of disabled entry fields on the materials page
Contributes to CURA-342
This commit is contained in:
parent
7df5008d3c
commit
6b9689c2c7
4 changed files with 136 additions and 14 deletions
46
resources/qml/Preferences/ReadOnlyTextField.qml
Normal file
46
resources/qml/Preferences/ReadOnlyTextField.qml
Normal file
|
@ -0,0 +1,46 @@
|
|||
// Copyright (c) 2016 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Dialogs 1.2
|
||||
|
||||
Item
|
||||
{
|
||||
id: base
|
||||
|
||||
property alias text: textField.text
|
||||
|
||||
signal editingFinished();
|
||||
|
||||
property bool readOnly: false
|
||||
|
||||
width: textField.width
|
||||
height: textField.height
|
||||
|
||||
TextField
|
||||
{
|
||||
id: textField
|
||||
|
||||
enabled: !base.readOnly
|
||||
opacity: base.readOnly ? 0.5 : 1.0
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
onEditingFinished: base.editingFinished()
|
||||
}
|
||||
|
||||
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