login pages adapt margins when downsize window

This commit is contained in:
gaelle 2025-03-24 15:52:45 +01:00 committed by Gaelle Braud
parent ee8e8a4fa8
commit 50fadef681
7 changed files with 45 additions and 20 deletions

View file

@ -7,12 +7,12 @@ import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
ColumnLayout {
id: mainItem
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Math.round(8 * DefaultStyle.dp)
FormItemLayout {
id: username
Layout.preferredWidth: Math.round(346 * DefaultStyle.dp)
//: "Nom d'utilisateur" : username
//: Nom d'utilisateur : username
label: qsTr("username")
mandatory: true
enableErrorText: true
@ -28,7 +28,7 @@ ColumnLayout {
FormItemLayout {
id: password
width: Math.round(346 * DefaultStyle.dp)
//: "Mot de passe"
//: Mot de passe
label: qsTr("password")
mandatory: true
enableErrorText: true

View file

@ -52,7 +52,8 @@ LoginLayout {
RowLayout {
visible: !SettingsCpp.assistantHideCreateAccount
spacing: Math.round(20 * DefaultStyle.dp)
Layout.rightMargin: Math.round(51 * DefaultStyle.dp)
Layout.rightMargin: Math.round((51 - ((51/(DefaultStyle.defaultWidth - mainWindow.minimumWidth))*(DefaultStyle.defaultWidth-mainWindow.width))) * DefaultStyle.dp)
Text {
Layout.rightMargin: Math.round(15 * DefaultStyle.dp)
//: "Pas encore de compte ?"
@ -77,7 +78,6 @@ LoginLayout {
anchors.left: parent.left
anchors.top: parent.top
anchors.leftMargin: Math.round(127 * DefaultStyle.dp)
anchors.topMargin: Math.round(70 * DefaultStyle.dp)
anchors.bottom: parent.bottom
ColumnLayout {
id: content

View file

@ -185,7 +185,7 @@ LoginLayout {
width: Math.round(361 * DefaultStyle.dp)
ColumnLayout {
spacing: Math.round(16 * DefaultStyle.dp)
spacing: Math.round(8 * DefaultStyle.dp)
FormItemLayout {
id: username
//: "Nom d'utilisateur"
@ -284,7 +284,7 @@ LoginLayout {
BigButton {
id: connectionButton
Layout.topMargin: Math.round(32 * DefaultStyle.dp)
Layout.topMargin: Math.round(15 * DefaultStyle.dp)
style: ButtonStyle.main
contentItem: StackLayout {
id: connectionButtonContent
@ -368,7 +368,6 @@ LoginLayout {
anchors.top: parent.top
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.topMargin: Math.round(70 * DefaultStyle.dp)
anchors.leftMargin: Math.round(127 * DefaultStyle.dp)
width: Math.round(361 * DefaultStyle.dp)
},

View file

@ -62,7 +62,6 @@ LoginLayout {
ColumnLayout {
anchors.left: parent.left
anchors.top: parent.top
anchors.topMargin: Math.round(51 * DefaultStyle.dp)
anchors.leftMargin: Math.round(127 * DefaultStyle.dp)
spacing: Math.round(104 * DefaultStyle.dp)
Text {

View file

@ -66,7 +66,7 @@ LoginLayout {
},
RowLayout {
spacing: Math.round(20 * DefaultStyle.dp)
Layout.rightMargin: Math.round(51 * DefaultStyle.dp)
Layout.rightMargin: Math.round((51 - ((51/(DefaultStyle.defaultWidth - mainWindow.minimumWidth))*(DefaultStyle.defaultWidth-mainWindow.width))) * DefaultStyle.dp)
Text {
Layout.rightMargin: Math.round(15 * DefaultStyle.dp)
color: DefaultStyle.main2_700
@ -90,14 +90,15 @@ LoginLayout {
centerContent: [
ColumnLayout {
id: registerForm
anchors.fill: parent
anchors.topMargin: Math.round(51 * DefaultStyle.dp)
anchors.leftMargin: Math.round(127 * DefaultStyle.dp)
anchors.rightMargin: Math.round(127 * DefaultStyle.dp)
spacing: Math.round(50 * DefaultStyle.dp)
TabBar {
Layout.fillWidth: true
id: bar
Layout.rightMargin: Math.round((127 - ((127/(DefaultStyle.defaultWidth - mainWindow.minimumWidth))*(DefaultStyle.defaultWidth-mainWindow.width))) * DefaultStyle.dp)
// "S'inscrire avec un numéro de téléphone"
model: [qsTr("assistant_account_register_with_phone_number"),
// "S'inscrire avec un email"
@ -106,11 +107,27 @@ LoginLayout {
Flickable {
Layout.fillWidth: true
Layout.fillHeight: true
contentHeight: contentLayout.height
Control.ScrollBar.vertical: ScrollBar {
id: scrollbar
z: 1
active: true
interactive: true
visible: parent.contentHeight > parent.height
policy: Control.ScrollBar.AsNeeded
anchors.rightMargin: 8 * DefaultStyle.dp
anchors.right: parent.right
}
ColumnLayout {
id: contentLayout
anchors.left: parent.left
anchors.right: parent.right
spacing: Math.round(22 * DefaultStyle.dp)
spacing: Math.round(8 * DefaultStyle.dp)
ColumnLayout {
id: formLayout
spacing: Math.round(24 * DefaultStyle.dp)
RowLayout {
Layout.preferredHeight: usernameItem.height
@ -296,6 +313,7 @@ LoginLayout {
},
Image {
z: -1
// visible: registerForm.x+registerForm.width < x
anchors.top: parent.top
anchors.right: parent.right
anchors.topMargin: Math.round(129 * DefaultStyle.dp)

View file

@ -125,11 +125,11 @@ Rectangle {
ColumnLayout {
id: contentLayout
anchors.fill: parent
spacing: 0
RowLayout {
spacing: 0
RowLayout {
Layout.fillWidth: true
Layout.preferredHeight: Math.round(102 * DefaultStyle.dp)
Layout.rightMargin: Math.round(42 * DefaultStyle.dp)
Layout.topMargin: Math.round((25 - ((25/(DefaultStyle.defaultHeight - mainWindow.minimumHeight))*(DefaultStyle.defaultHeight-mainWindow.height))) * DefaultStyle.dp)
Layout.rightMargin: Math.round((42 - ((42/(DefaultStyle.defaultWidth - mainWindow.minimumWidth))*(DefaultStyle.defaultWidth-mainWindow.width))) * DefaultStyle.dp)
spacing: 0
Item {
Layout.fillWidth: true
@ -149,14 +149,17 @@ Rectangle {
RowLayout {
id: titleLayout
Layout.preferredHeight: Math.round(131 * DefaultStyle.dp)
Layout.fillWidth: true
Layout.topMargin: Math.round((40 - ((40/(DefaultStyle.defaultHeight - mainWindow.minimumHeight))*(DefaultStyle.defaultHeight-mainWindow.height))) * DefaultStyle.dp)
spacing: 0
}
Item {
id: centerLayout
Layout.fillHeight: true
Layout.fillWidth: true
Layout.topMargin: Math.round((70 - ((70/(DefaultStyle.defaultHeight - mainWindow.minimumHeight))*(DefaultStyle.defaultHeight-mainWindow.height))) * DefaultStyle.dp)
Layout.alignment: Qt.AlignBottom
}
Image {
id: bottomMountains

View file

@ -13,10 +13,16 @@ AbstractWindow {
title: applicationName
// TODO : handle this bool when security mode is implemented
property bool firstConnection: true
property int initialWidth
property int initialHeight
Component.onCompleted: {
initialWidth = width
initialHeight = height
}
color: DefaultStyle.grey_0
// minimumWidth: 1020
// minimumHeight: 700
minimumWidth: Math.round(1020 * DefaultStyle.dp)
minimumHeight: Math.round(735 * DefaultStyle.dp)
signal callCreated()
property var accountProxy