From c643be5d218c1bf8ea591f6ac5139ce6c0ee3668 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Wed, 25 Oct 2023 14:59:13 +0200 Subject: [PATCH] fix login form layout --- Linphone/view/Item/Form/LoginForm.qml | 98 +++++++++++++---------- Linphone/view/Page/Login/LoginPage.qml | 4 +- Linphone/view/Page/Login/SIPLoginPage.qml | 4 - 3 files changed, 59 insertions(+), 47 deletions(-) diff --git a/Linphone/view/Item/Form/LoginForm.qml b/Linphone/view/Item/Form/LoginForm.qml index 7db2c65bd..df0f34d6d 100644 --- a/Linphone/view/Item/Form/LoginForm.qml +++ b/Linphone/view/Item/Form/LoginForm.qml @@ -3,54 +3,68 @@ import QtQuick.Layouts 1.0 import QtQuick.Controls as Control import Linphone -RowLayout { +ColumnLayout { + id: root Layout.alignment: Qt.AlignBottom - ColumnLayout { - TextInput { - id: username - label: "Username" - mandatory: true - textInputWidth: 250 - } - TextInput { - id: password - label: "Password" - mandatory: true - hidden: true - textInputWidth: 250 - } + signal useSIPButtonClicked() + RowLayout { + ColumnLayout { + Layout.fillHeight: true + Layout.fillWidth: true + clip: true - RowLayout { - id: lastFormLineLayout - Button { - text: 'Log in' - Layout.rightMargin: 20 - onClicked: { - LoginPageCpp.login(username.inputText, password.inputText); + ColumnLayout { + TextInput { + id: username + label: "Username" + mandatory: true + textInputWidth: 250 + } + TextInput { + id: password + label: "Password" + mandatory: true + hidden: true + textInputWidth: 250 + } + + RowLayout { + id: lastFormLineLayout + Button { + text: 'Log in' + Layout.rightMargin: 20 + onClicked: { + LoginPageCpp.login(username.inputText, password.inputText); + } + } + Text { + color: DefaultStyle.grayColor + text: "Forgotten password?" + font.underline: true + font.pointSize: DefaultStyle.defaultTextSize + } + + } + + Button { + Layout.topMargin: 40 + inversedColors: true + text: "Use SIP Account" + onClicked: {root.useSIPButtonClicked()} } } - Text { - color: DefaultStyle.grayColor - text: "Forgotten password?" - font.underline: true - font.pointSize: DefaultStyle.defaultTextSize - } - } - Button { - Layout.topMargin: 40 - inversedColors: true - text: "Use SIP Account" - onClicked: {root.useSIPButtonClicked()} + Item { + Layout.fillWidth: true + } + Image { + Layout.rightMargin: 40 + Layout.preferredWidth: 300 + fillMode: Image.PreserveAspectFit + source: AppIcons.loginImage } } Item { - Layout.fillWidth: true + Layout.fillHeight: true } - Image { - Layout.rightMargin: 40 - Layout.preferredWidth: 300 - fillMode: Image.PreserveAspectFit - source: AppIcons.loginImage - } -} +} \ No newline at end of file diff --git a/Linphone/view/Page/Login/LoginPage.qml b/Linphone/view/Page/Login/LoginPage.qml index 98b97beea..47d178bb6 100644 --- a/Linphone/view/Page/Login/LoginPage.qml +++ b/Linphone/view/Page/Login/LoginPage.qml @@ -35,6 +35,8 @@ LoginLayout { } } - centerContent: LoginForm {} + centerContent: LoginForm { + onUseSIPButtonClicked: root.useSIPButtonClicked() + } } diff --git a/Linphone/view/Page/Login/SIPLoginPage.qml b/Linphone/view/Page/Login/SIPLoginPage.qml index a04a19465..544a5a1c9 100644 --- a/Linphone/view/Page/Login/SIPLoginPage.qml +++ b/Linphone/view/Page/Login/SIPLoginPage.qml @@ -63,8 +63,6 @@ LoginLayout { Component { id: firstItem ColumnLayout { - // Layout.fillWidth: true - // Layout.fillHeight: true Text { Layout.preferredWidth: 361 @@ -111,8 +109,6 @@ LoginLayout { Component { id: secondItem ColumnLayout { - // Layout.fillWidth: true - // Layout.fillHeight: true TextInput { id: username label: "Username"