fix login form layout

This commit is contained in:
Gaelle Braud 2023-10-25 14:59:13 +02:00
parent 154a322dd3
commit c643be5d21
3 changed files with 59 additions and 47 deletions

View file

@ -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
}
}
}

View file

@ -35,6 +35,8 @@ LoginLayout {
}
}
centerContent: LoginForm {}
centerContent: LoginForm {
onUseSIPButtonClicked: root.useSIPButtonClicked()
}
}

View file

@ -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"