Compare commits

...

2 Commits

Author SHA1 Message Date
Aurelien Vaillant 3697258d07 Make the main view functional 2024-08-13 15:38:24 +02:00
Aurelien Vaillant 4bb7ec2ba0 Split the main view on 2 2024-08-13 11:26:45 +02:00
6 changed files with 78 additions and 26 deletions
+25 -12
View File
@@ -1,19 +1,32 @@
import QtQuick 2.5
import fbx.application 1.0
import "Views" 1.0
import "Views" as View
Application {
Image {
source: "icon.png"
}
Text {
text: "Connect to Jellifyn server"
}
// Liste des labels et types
property var fields: [
{label: "Server", type: "text"},
{label: "User", type: "text"},
{label: "Password", type: "password"}
]
GridView {
model: ViewLogin {}
delegate: Column {
Text { text: name; anchors.horizontalCenter: parent.horizontalCenter }
}
Row {
anchors.fill: parent
spacing: 10
Rectangle {
width: parent.width / 3 - 5
height: parent.height
View.Logo {}
}
Rectangle {
width: parent.width / 3 * 2 - 5
height: parent.height
color: "#000B25"
View.Login {}
}
}
}
+38
View File
@@ -0,0 +1,38 @@
import QtQuick 2.5
Column {
anchors.fill: parent
anchors.margins: 20
spacing: 15
// 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 {
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
color: "white"
text: modelData.label
// Détermine le mode de saisie en fonction du type
echoMode: modelData.type === "password" ? TextInput.Password : TextInput.Normal
//echoMode: TextInput.Password
}
}
}
}
+14
View File
@@ -0,0 +1,14 @@
import QtQuick 2.5
// Display the logo
Rectangle {
width: parent.width
height: parent.height
color: "#000B25"
Image {
anchors.centerIn: parent
source: "../icon.png"
}
}
-13
View File
@@ -1,13 +0,0 @@
import QtQuick 2.5
ListModel {
ListElement {
name: "Server"
}
ListElement {
name: "Username"
}
ListElement {
name: "Password"
}
}
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 13 KiB

+1 -1
View File
@@ -4,7 +4,7 @@
"description": "Jellyfin for Freebox",
"icon": "icon.png",
"capabilities": {
"net_wan": "required",
"net_wan": "required"
},
"entryPoints": {
"main": {