Files
Jellyfin-Freebox/Views/Login.qml
T

53 lines
1.4 KiB
QML
Raw Normal View History

2024-08-12 16:53:09 +02:00
import QtQuick 2.5
2024-08-13 15:38:24 +02:00
Column {
2024-08-13 16:57:08 +02:00
// Liste des labels et types
property var fields: [
{label: "Server", type: "text"},
{label: "User", type: "text"},
{label: "Password", type: "password"}
]
//anchors.centerIn: parent
anchors.verticalCenter: parent.verticalCenter
2024-08-13 15:38:24 +02:00
anchors.margins: 20
spacing: 15
2024-08-13 16:57:08 +02:00
width: parent.width * 0.8
2024-08-13 15:38:24 +02:00
// Repeater pour générer les champs basés sur la liste des labels et types
Repeater {
model: fields
Row {
spacing: 10
Text {
2024-08-13 16:57:08 +02:00
width: parent.width / 2 - 5
2024-08-13 15:38:24 +02:00
text: modelData.label + ":"
color: "white"
font.pixelSize: 16
}
// TextInput pour les champs Server et User, et mode Password pour Password
2024-08-13 16:57:08 +02:00
Rectangle {
width: 200
height: 20
2024-08-13 15:38:24 +02:00
color: "white"
2024-08-13 16:57:08 +02:00
//border.color: "black"
//border.width: 3
//radius: 5
TextInput {
font.pixelSize: 16
color: "black"
text: modelData.label
2024-08-13 15:38:24 +02:00
2024-08-13 16:57:08 +02:00
// Détermine le mode de saisie en fonction du type
echoMode: modelData.type === "password" ? TextInput.Password : TextInput.Normal
}
2024-08-13 15:38:24 +02:00
}
}
2024-08-12 16:53:09 +02:00
}
}