Add all view
This commit is contained in:
1 parent
186cff1d73
commit
49d8524597
18 files changed
+1007
-98
No files matched your search
@@ -0,0 +1,71 @@
|
||||
import QtQuick 2.5
|
||||
import "."
|
||||
|
||||
// Champ de saisie avec libellé. Haut/Bas ne sont pas consommés par le TextInput
|
||||
// et remontent donc jusqu'au KeyNavigation posé sur ce composant.
|
||||
FocusScope {
|
||||
id: root
|
||||
|
||||
property alias label: labelText.text
|
||||
property alias text: input.text
|
||||
property alias placeholder: placeholderText.text
|
||||
property bool password: false
|
||||
signal accepted()
|
||||
|
||||
implicitWidth: 400
|
||||
implicitHeight: column.implicitHeight
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: input.forceActiveFocus()
|
||||
}
|
||||
|
||||
Column {
|
||||
id: column
|
||||
width: parent.width
|
||||
spacing: Theme.spacingS
|
||||
|
||||
Text {
|
||||
id: labelText
|
||||
visible: text !== ""
|
||||
color: root.activeFocus ? Theme.text : Theme.textMuted
|
||||
font.pixelSize: Theme.fontSmall
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: Theme.controlHeight
|
||||
radius: Theme.radius
|
||||
color: Theme.surface
|
||||
border.width: 2
|
||||
border.color: root.activeFocus ? Theme.accent : Theme.border
|
||||
|
||||
TextInput {
|
||||
id: input
|
||||
anchors {
|
||||
fill: parent
|
||||
leftMargin: Theme.spacingM
|
||||
rightMargin: Theme.spacingM
|
||||
}
|
||||
focus: true
|
||||
clip: true
|
||||
verticalAlignment: TextInput.AlignVCenter
|
||||
color: Theme.text
|
||||
selectionColor: Theme.accent
|
||||
font.pixelSize: Theme.fontBody
|
||||
echoMode: root.password ? TextInput.Password : TextInput.Normal
|
||||
onAccepted: root.accepted()
|
||||
}
|
||||
|
||||
Text {
|
||||
id: placeholderText
|
||||
anchors.fill: input
|
||||
visible: input.text === ""
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: Theme.textMuted
|
||||
font: input.font
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user