diff --git a/nymea-app/resources.qrc b/nymea-app/resources.qrc
index 7900a598..e9e87e92 100644
--- a/nymea-app/resources.qrc
+++ b/nymea-app/resources.qrc
@@ -326,5 +326,6 @@
ui/shaders/brightnesscircle.frag.qsb
ui/shaders/colorizedimage.frag.qsb
ui/system/EvDashSettingsPage.qml
+ ui/components/UsernameTextField.qml
diff --git a/nymea-app/ui/Nymea.qml b/nymea-app/ui/Nymea.qml
index a370e168..e16d27d6 100644
--- a/nymea-app/ui/Nymea.qml
+++ b/nymea-app/ui/Nymea.qml
@@ -125,7 +125,7 @@ ApplicationWindow {
onOpenMagicSettings: rootItem.openMagicSettings();
onOpenAppSettings: rootItem.openAppSettings();
onOpenSystemSettings: rootItem.openSystemSettings();
- onOpenCustomPage: rootItem.openCustomPage(page);
+ onOpenCustomPage: (page) => rootItem.openCustomPage(page);
onConfigureMainView: rootItem.configureMainView();
onStartManualConnection: rootItem.startManualConnection();
onStartWirelessSetup: rootItem.startWirelessSetup();
diff --git a/nymea-app/ui/components/PasswordTextField.qml b/nymea-app/ui/components/PasswordTextField.qml
index 324d63d9..1d4df06a 100644
--- a/nymea-app/ui/components/PasswordTextField.qml
+++ b/nymea-app/ui/components/PasswordTextField.qml
@@ -131,6 +131,8 @@ ColumnLayout {
}
}
+ spacing: root.signup ? Style.margins : 0
+
RowLayout {
visible: root.signup
diff --git a/nymea-app/ui/components/UsernameTextField.qml b/nymea-app/ui/components/UsernameTextField.qml
new file mode 100644
index 00000000..8fb5f1dd
--- /dev/null
+++ b/nymea-app/ui/components/UsernameTextField.qml
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+*
+* Copyright (C) 2013 - 2024, nymea GmbH
+* Copyright (C) 2024 - 2025, chargebyte austria GmbH
+*
+* This file is part of nymea-app.
+*
+* nymea-app is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* nymea-app is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with nymea-app. If not, see .
+*
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+import QtQuick
+import QtQuick.Controls
+
+NymeaTextField {
+ id: root
+ placeholderText: (engine.jsonRpcClient.ensureServerVersion("6.0") ? qsTr("Username") : qsTr("Your e-mail address"))
+ inputMethodHints: engine.jsonRpcClient.ensureServerVersion("6.0")
+ ? Qt.ImhEmailCharactersOnly | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
+ : Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
+ validator: RegularExpressionValidator {
+ regularExpression: /[a-zA-Z0-9_\\.+-@]{3,}/
+ }
+}
diff --git a/nymea-app/ui/connection/LoginPage.qml b/nymea-app/ui/connection/LoginPage.qml
index 599f2926..1fec8c32 100644
--- a/nymea-app/ui/connection/LoginPage.qml
+++ b/nymea-app/ui/connection/LoginPage.qml
@@ -39,7 +39,6 @@ SettingsPageBase {
onBackPressed: root.backPressed()
}
-
Connections {
target: engine.jsonRpcClient
onAuthenticationFailed: {
@@ -104,36 +103,21 @@ SettingsPageBase {
}
- GridLayout {
+ ColumnLayout {
id: loginForm
Layout.fillWidth: true
- Layout.leftMargin: app.margins; Layout.rightMargin: app.margins
- columns: app.width > 500 ? 2 : 1
- columnSpacing: app.margins
+ Layout.leftMargin: app.margins
+ Layout.rightMargin: app.margins
+ spacing: app.margins
property bool showErrors: false
- Label {
- text: (engine.jsonRpcClient.ensureServerVersion("6.0") ? qsTr("Username") : qsTr("Your e-mail address"))
- Layout.fillWidth: true
- Layout.minimumWidth: implicitWidth
- }
- NymeaTextField {
+ UsernameTextField {
id: usernameTextField
Layout.fillWidth: true
- placeholderText: qsTr("Required")
- inputMethodHints: engine.jsonRpcClient.ensureServerVersion("6.0")
- ? Qt.ImhEmailCharactersOnly | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
- : Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
error: loginForm.showErrors && !acceptableInput
- validator: RegularExpressionValidator {
- regularExpression: /[a-zA-Z0-9_\\.+-@]{3,}/
- }
- }
- Label {
- Layout.fillWidth: true
- text: qsTr("Password")
}
+
PasswordTextField {
id: passwordTextField
Layout.fillWidth: true
@@ -146,27 +130,17 @@ SettingsPageBase {
}
}
- Label {
- text: qsTr("Your name")
- Layout.fillWidth: true
- visible: engine.jsonRpcClient.ensureServerVersion("6.0") && engine.jsonRpcClient.initialSetupRequired
- }
TextField {
id: displayNameTextField
Layout.fillWidth: true
- placeholderText: qsTr("Optional")
+ placeholderText: qsTr("Your name") + " (" + qsTr("Optional") + ")"
visible: engine.jsonRpcClient.ensureServerVersion("6.0") && engine.jsonRpcClient.initialSetupRequired
}
- Label {
- text: qsTr("Email")
- Layout.fillWidth: true
- visible: engine.jsonRpcClient.ensureServerVersion("6.0") && engine.jsonRpcClient.initialSetupRequired
- }
TextField {
id: emailTextField
Layout.fillWidth: true
- placeholderText: qsTr("Optional")
+ placeholderText: qsTr("Email") + " (" + qsTr("Optional") + ")"
visible: engine.jsonRpcClient.ensureServerVersion("6.0") && engine.jsonRpcClient.initialSetupRequired
}
}
diff --git a/nymea-app/ui/system/UsersSettingsPage.qml b/nymea-app/ui/system/UsersSettingsPage.qml
index 50c1fde1..7a0b8664 100644
--- a/nymea-app/ui/system/UsersSettingsPage.qml
+++ b/nymea-app/ui/system/UsersSettingsPage.qml
@@ -141,27 +141,27 @@ SettingsPageBase {
SettingsPageBase {
id: editUserInfoPage
title: qsTr("Edit user information")
- GridLayout {
+
+ ColumnLayout {
+ Layout.fillWidth: true
Layout.margins: Style.margins
- columnSpacing: Style.margins
- columns: 2
- Label {
- text: qsTr("Your name")
- }
- NymeaTextField {
+ spacing: Style.margins
+
+ TextField {
id: displayNameTextField
Layout.fillWidth: true
+ placeholderText: qsTr("Your name")
text: userManager.userInfo.displayName
}
- Label {
- text: qsTr("Email")
- }
- NymeaTextField {
+
+ TextField {
id: emailTextField
Layout.fillWidth: true
+ placeholderText: qsTr("Email")
text: userManager.userInfo.email
}
}
+
Button {
Layout.fillWidth: true
Layout.margins: Style.margins
@@ -171,6 +171,7 @@ SettingsPageBase {
userManager.setUserInfo(userManager.userInfo.username, displayNameTextField.text, emailTextField.text)
}
}
+
Connections {
target: userManager
onSetUserInfoReply: (id, error) => {
@@ -262,6 +263,7 @@ SettingsPageBase {
Layout.fillWidth: true
Layout.leftMargin: app.margins
Layout.rightMargin: app.margins
+ bottomPadding: Style.margins
text: qsTr("Please enter the new password for %1").arg(userManager.userInfo.username)
wrapMode: Text.WordWrap
}
@@ -400,25 +402,22 @@ SettingsPageBase {
text: qsTr("User information for %1").arg(userDetailsPage.userInfo.username)
}
- GridLayout {
+ ColumnLayout {
Layout.leftMargin: Style.margins
Layout.rightMargin: Style.margins
- columnSpacing: Style.margins
- columns: 2
- Label {
- text: qsTr("Name")
- }
+ spacing: Style.margins
+
NymeaTextField {
id: displayNameTextField
Layout.fillWidth: true
+ placeholderText: qsTr("Name")
text: userDetailsPage.userInfo.displayName
}
- Label {
- text: qsTr("Email")
- }
+
NymeaTextField {
id: emailTextField
Layout.fillWidth: true
+ placeholderText: qsTr("Email")
text: userDetailsPage.userInfo.email
}
}
@@ -548,43 +547,31 @@ SettingsPageBase {
text: qsTr("User information")
}
- GridLayout {
+ ColumnLayout {
Layout.fillWidth: true
Layout.leftMargin: Style.margins
Layout.rightMargin: Style.margins
- columns: 2
- Label {
- text: qsTr("Username:") + "*"
- }
- TextField {
+ spacing: Style.margins
+
+ UsernameTextField {
id: usernameTextField
Layout.fillWidth: true
- inputMethodHints: Qt.ImhNoAutoUppercase
}
- Label {
- text: qsTr("Password:") + "*"
- Layout.alignment: Qt.AlignTop
- Layout.topMargin: Style.smallMargins
- }
PasswordTextField {
id: passwordTextField
Layout.fillWidth: true
}
- Label {
- text: qsTr("Full name:")
- }
TextField {
id: displayNameTextField
+ placeholderText: qsTr("Full name:") + " (" + qsTr("Optional") + ")"
Layout.fillWidth: true
}
- Label {
- text: qsTr("e-mail:")
- }
TextField {
id: emailTextField
+ placeholderText: qsTr("Email") + " (" + qsTr("Optional") + ")"
Layout.fillWidth: true
}
}