From 1b28d953c2525d0138d17c2a50036dfb48964eae Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Tue, 13 Aug 2024 16:57:08 +0200 Subject: [PATCH] View login UI functional --- Jellyfin.qml | 7 ------- Views/Login.qml | 38 ++++++++++++++++++++++++++------------ 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/Jellyfin.qml b/Jellyfin.qml index c4c0170..8a288a7 100644 --- a/Jellyfin.qml +++ b/Jellyfin.qml @@ -3,13 +3,6 @@ import fbx.application 1.0 import "Views" as View Application { - // Liste des labels et types - property var fields: [ - {label: "Server", type: "text"}, - {label: "User", type: "text"}, - {label: "Password", type: "password"} - ] - Row { anchors.fill: parent spacing: 10 diff --git a/Views/Login.qml b/Views/Login.qml index b9b6501..45efb12 100644 --- a/Views/Login.qml +++ b/Views/Login.qml @@ -1,37 +1,51 @@ import QtQuick 2.5 Column { - anchors.fill: parent + // 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 anchors.margins: 20 spacing: 15 + width: parent.width * 0.8 + // Repeater pour générer les champs basés sur la liste des labels et types Repeater { model: fields Row { - width: parent.width spacing: 10 Text { + width: parent.width / 2 - 5 text: modelData.label + ":" - width: 100 color: "white" - verticalAlignment: Text.AlignVCenter font.pixelSize: 16 } // TextInput pour les champs Server et User, et mode Password pour Password - TextInput { - width: parent.width - 110 - height: 30 - font.pixelSize: 16 + Rectangle { + width: 200 + height: 20 color: "white" - text: modelData.label + //border.color: "black" + //border.width: 3 + //radius: 5 - // Détermine le mode de saisie en fonction du type - echoMode: modelData.type === "password" ? TextInput.Password : TextInput.Normal - //echoMode: TextInput.Password + TextInput { + font.pixelSize: 16 + color: "black" + text: modelData.label + + // Détermine le mode de saisie en fonction du type + echoMode: modelData.type === "password" ? TextInput.Password : TextInput.Normal + } } } }