Add default... + reset() to field, area & checkbox
This commit is contained in:
parent
407396e01e
commit
0ab7a008cf
|
@ -5,17 +5,10 @@ import "../utils.js" as Utils
|
|||
|
||||
CheckBox {
|
||||
id: box
|
||||
checked: defaultChecked
|
||||
spacing: theme.spacing
|
||||
padding: 0
|
||||
|
||||
|
||||
property alias mainText: mainText
|
||||
property alias subtitle: subtitleText
|
||||
|
||||
|
||||
Behavior on opacity { HOpacityAnimator { factor: 2 } }
|
||||
|
||||
|
||||
indicator: Rectangle {
|
||||
opacity: box.enabled ? 1 : theme.disabledElementsOpacity + 0.2
|
||||
implicitWidth: theme.controls.checkBox.boxSize
|
||||
|
@ -84,4 +77,16 @@ CheckBox {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
property alias mainText: mainText
|
||||
property alias subtitle: subtitleText
|
||||
property bool defaultChecked: false
|
||||
readonly property bool changed: checked !== defaultChecked
|
||||
|
||||
|
||||
function reset() { checked = defaultChecked }
|
||||
|
||||
|
||||
Behavior on opacity { HOpacityAnimator { factor: 2 } }
|
||||
}
|
||||
|
|
|
@ -28,14 +28,21 @@ ScrollView {
|
|||
property alias placeholderTextColor: textArea.placeholderTextColor
|
||||
property alias area: textArea
|
||||
property alias text: textArea.text
|
||||
property var disabledText: null
|
||||
|
||||
property var focusItemOnTab: null
|
||||
property var disabledText: null
|
||||
property string defaultText: ""
|
||||
readonly property bool changed: text !== defaultText
|
||||
|
||||
|
||||
function reset() { area.clear(); text = defaultText }
|
||||
|
||||
|
||||
Behavior on opacity { HOpacityAnimator {} }
|
||||
|
||||
TextArea {
|
||||
id: textArea
|
||||
text: defaultText
|
||||
enabled: parent.enabled
|
||||
leftPadding: theme.spacing
|
||||
rightPadding: leftPadding
|
||||
|
|
|
@ -3,6 +3,7 @@ import QtQuick.Controls 2.12
|
|||
|
||||
TextField {
|
||||
id: field
|
||||
text: defaultText
|
||||
opacity: enabled ? 1 : theme.disabledElementsOpacity
|
||||
selectByMouse: true
|
||||
leftPadding: theme.spacing
|
||||
|
@ -62,6 +63,11 @@ TextField {
|
|||
property color focusedBorderColor: theme.controls.textField.focusedBorder
|
||||
|
||||
property var disabledText: null
|
||||
property string defaultText: ""
|
||||
readonly property bool changed: text !== defaultText
|
||||
|
||||
|
||||
function reset() { clear(); text = defaultText }
|
||||
|
||||
|
||||
Binding on color {
|
||||
|
|
Loading…
Reference in New Issue
Block a user