mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-18 17:49:00 +00:00
feat(StatusInput): introduce leftPadding
and rightPadding
properties
This commit is contained in:
parent
ada657fab6
commit
8e4b5e2c09
@ -29,6 +29,8 @@ Item {
|
|||||||
property string secondaryLabel: ""
|
property string secondaryLabel: ""
|
||||||
property int charLimit: 0
|
property int charLimit: 0
|
||||||
property string errorMessage: ""
|
property string errorMessage: ""
|
||||||
|
property real leftPadding: 16
|
||||||
|
property real rightPadding: 16
|
||||||
property list<StatusValidator> validators
|
property list<StatusValidator> validators
|
||||||
property int validationMode: StatusInput.ValidationMode.OnlyWhenDirty
|
property int validationMode: StatusInput.ValidationMode.OnlyWhenDirty
|
||||||
enum ValidationMode {
|
enum ValidationMode {
|
||||||
@ -85,9 +87,9 @@ Item {
|
|||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.topMargin: visible ? 8 : 0
|
anchors.topMargin: visible ? 8 : 0
|
||||||
anchors.leftMargin: 16
|
anchors.leftMargin: root.leftPadding
|
||||||
anchors.right: (charLimitLabel.visible ? charLimitLabel.right : parent.right)
|
anchors.right: (charLimitLabel.visible ? charLimitLabel.right : parent.right)
|
||||||
anchors.rightMargin: 16
|
anchors.rightMargin: root.rightPadding
|
||||||
height: visible ? 17 : 0
|
height: visible ? 17 : 0
|
||||||
visible: !!root.label
|
visible: !!root.label
|
||||||
spacing: 5
|
spacing: 5
|
||||||
@ -116,7 +118,7 @@ Item {
|
|||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.topMargin: visible ? 11 : 0
|
anchors.topMargin: visible ? 11 : 0
|
||||||
anchors.rightMargin: 16
|
anchors.rightMargin: root.rightPadding
|
||||||
visible: root.charLimit > 0
|
visible: root.charLimit > 0
|
||||||
|
|
||||||
text: "%1 / %2".arg(statusBaseInput.text.length).arg(root.charLimit)
|
text: "%1 / %2".arg(statusBaseInput.text.length).arg(root.charLimit)
|
||||||
@ -131,8 +133,8 @@ Item {
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.topMargin: charLimitLabel.visible ? 11 : 8
|
anchors.topMargin: charLimitLabel.visible ? 11 : 8
|
||||||
anchors.leftMargin: 16
|
anchors.leftMargin: root.leftPadding
|
||||||
anchors.rightMargin: 16
|
anchors.rightMargin: root.rightPadding
|
||||||
maximumLength: root.charLimit
|
maximumLength: root.charLimit
|
||||||
onTextChanged: root.validate()
|
onTextChanged: root.validate()
|
||||||
|
|
||||||
@ -145,9 +147,9 @@ Item {
|
|||||||
anchors.top: statusBaseInput.bottom
|
anchors.top: statusBaseInput.bottom
|
||||||
anchors.topMargin: 11
|
anchors.topMargin: 11
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 16
|
anchors.rightMargin: root.rightPadding
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: 16
|
anchors.leftMargin: root.leftPadding
|
||||||
|
|
||||||
height: visible ? implicitHeight : 0
|
height: visible ? implicitHeight : 0
|
||||||
visible: !!text && !statusBaseInput.valid
|
visible: !!text && !statusBaseInput.valid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user