login pages adapt margins when downsize window
This commit is contained in:
parent
ee8e8a4fa8
commit
50fadef681
7 changed files with 45 additions and 20 deletions
|
|
@ -7,12 +7,12 @@ import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: mainItem
|
id: mainItem
|
||||||
spacing: Math.round(10 * DefaultStyle.dp)
|
spacing: Math.round(8 * DefaultStyle.dp)
|
||||||
|
|
||||||
FormItemLayout {
|
FormItemLayout {
|
||||||
id: username
|
id: username
|
||||||
Layout.preferredWidth: Math.round(346 * DefaultStyle.dp)
|
Layout.preferredWidth: Math.round(346 * DefaultStyle.dp)
|
||||||
//: "Nom d'utilisateur" : username
|
//: Nom d'utilisateur : username
|
||||||
label: qsTr("username")
|
label: qsTr("username")
|
||||||
mandatory: true
|
mandatory: true
|
||||||
enableErrorText: true
|
enableErrorText: true
|
||||||
|
|
@ -28,7 +28,7 @@ ColumnLayout {
|
||||||
FormItemLayout {
|
FormItemLayout {
|
||||||
id: password
|
id: password
|
||||||
width: Math.round(346 * DefaultStyle.dp)
|
width: Math.round(346 * DefaultStyle.dp)
|
||||||
//: "Mot de passe"
|
//: Mot de passe
|
||||||
label: qsTr("password")
|
label: qsTr("password")
|
||||||
mandatory: true
|
mandatory: true
|
||||||
enableErrorText: true
|
enableErrorText: true
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,8 @@ LoginLayout {
|
||||||
RowLayout {
|
RowLayout {
|
||||||
visible: !SettingsCpp.assistantHideCreateAccount
|
visible: !SettingsCpp.assistantHideCreateAccount
|
||||||
spacing: Math.round(20 * DefaultStyle.dp)
|
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 {
|
Text {
|
||||||
Layout.rightMargin: Math.round(15 * DefaultStyle.dp)
|
Layout.rightMargin: Math.round(15 * DefaultStyle.dp)
|
||||||
//: "Pas encore de compte ?"
|
//: "Pas encore de compte ?"
|
||||||
|
|
@ -77,7 +78,6 @@ LoginLayout {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.leftMargin: Math.round(127 * DefaultStyle.dp)
|
anchors.leftMargin: Math.round(127 * DefaultStyle.dp)
|
||||||
anchors.topMargin: Math.round(70 * DefaultStyle.dp)
|
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: content
|
id: content
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ LoginLayout {
|
||||||
width: Math.round(361 * DefaultStyle.dp)
|
width: Math.round(361 * DefaultStyle.dp)
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: Math.round(16 * DefaultStyle.dp)
|
spacing: Math.round(8 * DefaultStyle.dp)
|
||||||
FormItemLayout {
|
FormItemLayout {
|
||||||
id: username
|
id: username
|
||||||
//: "Nom d'utilisateur"
|
//: "Nom d'utilisateur"
|
||||||
|
|
@ -284,7 +284,7 @@ LoginLayout {
|
||||||
|
|
||||||
BigButton {
|
BigButton {
|
||||||
id: connectionButton
|
id: connectionButton
|
||||||
Layout.topMargin: Math.round(32 * DefaultStyle.dp)
|
Layout.topMargin: Math.round(15 * DefaultStyle.dp)
|
||||||
style: ButtonStyle.main
|
style: ButtonStyle.main
|
||||||
contentItem: StackLayout {
|
contentItem: StackLayout {
|
||||||
id: connectionButtonContent
|
id: connectionButtonContent
|
||||||
|
|
@ -368,7 +368,6 @@ LoginLayout {
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.topMargin: Math.round(70 * DefaultStyle.dp)
|
|
||||||
anchors.leftMargin: Math.round(127 * DefaultStyle.dp)
|
anchors.leftMargin: Math.round(127 * DefaultStyle.dp)
|
||||||
width: Math.round(361 * DefaultStyle.dp)
|
width: Math.round(361 * DefaultStyle.dp)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,6 @@ LoginLayout {
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: Math.round(51 * DefaultStyle.dp)
|
|
||||||
anchors.leftMargin: Math.round(127 * DefaultStyle.dp)
|
anchors.leftMargin: Math.round(127 * DefaultStyle.dp)
|
||||||
spacing: Math.round(104 * DefaultStyle.dp)
|
spacing: Math.round(104 * DefaultStyle.dp)
|
||||||
Text {
|
Text {
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ LoginLayout {
|
||||||
},
|
},
|
||||||
RowLayout {
|
RowLayout {
|
||||||
spacing: Math.round(20 * DefaultStyle.dp)
|
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 {
|
Text {
|
||||||
Layout.rightMargin: Math.round(15 * DefaultStyle.dp)
|
Layout.rightMargin: Math.round(15 * DefaultStyle.dp)
|
||||||
color: DefaultStyle.main2_700
|
color: DefaultStyle.main2_700
|
||||||
|
|
@ -90,14 +90,15 @@ LoginLayout {
|
||||||
|
|
||||||
centerContent: [
|
centerContent: [
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
id: registerForm
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.topMargin: Math.round(51 * DefaultStyle.dp)
|
|
||||||
anchors.leftMargin: Math.round(127 * DefaultStyle.dp)
|
anchors.leftMargin: Math.round(127 * DefaultStyle.dp)
|
||||||
anchors.rightMargin: Math.round(127 * DefaultStyle.dp)
|
|
||||||
spacing: Math.round(50 * DefaultStyle.dp)
|
spacing: Math.round(50 * DefaultStyle.dp)
|
||||||
|
|
||||||
TabBar {
|
TabBar {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
id: bar
|
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"
|
// "S'inscrire avec un numéro de téléphone"
|
||||||
model: [qsTr("assistant_account_register_with_phone_number"),
|
model: [qsTr("assistant_account_register_with_phone_number"),
|
||||||
// "S'inscrire avec un email"
|
// "S'inscrire avec un email"
|
||||||
|
|
@ -106,11 +107,27 @@ LoginLayout {
|
||||||
Flickable {
|
Flickable {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: 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 {
|
ColumnLayout {
|
||||||
|
id: contentLayout
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
spacing: Math.round(22 * DefaultStyle.dp)
|
spacing: Math.round(8 * DefaultStyle.dp)
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
id: formLayout
|
||||||
spacing: Math.round(24 * DefaultStyle.dp)
|
spacing: Math.round(24 * DefaultStyle.dp)
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.preferredHeight: usernameItem.height
|
Layout.preferredHeight: usernameItem.height
|
||||||
|
|
@ -296,6 +313,7 @@ LoginLayout {
|
||||||
},
|
},
|
||||||
Image {
|
Image {
|
||||||
z: -1
|
z: -1
|
||||||
|
// visible: registerForm.x+registerForm.width < x
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.topMargin: Math.round(129 * DefaultStyle.dp)
|
anchors.topMargin: Math.round(129 * DefaultStyle.dp)
|
||||||
|
|
|
||||||
|
|
@ -125,11 +125,11 @@ Rectangle {
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: contentLayout
|
id: contentLayout
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
spacing: 0
|
spacing: 0
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: Math.round(102 * DefaultStyle.dp)
|
Layout.topMargin: Math.round((25 - ((25/(DefaultStyle.defaultHeight - mainWindow.minimumHeight))*(DefaultStyle.defaultHeight-mainWindow.height))) * DefaultStyle.dp)
|
||||||
Layout.rightMargin: Math.round(42 * DefaultStyle.dp)
|
Layout.rightMargin: Math.round((42 - ((42/(DefaultStyle.defaultWidth - mainWindow.minimumWidth))*(DefaultStyle.defaultWidth-mainWindow.width))) * DefaultStyle.dp)
|
||||||
spacing: 0
|
spacing: 0
|
||||||
Item {
|
Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
@ -149,14 +149,17 @@ Rectangle {
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: titleLayout
|
id: titleLayout
|
||||||
Layout.preferredHeight: Math.round(131 * DefaultStyle.dp)
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: Math.round((40 - ((40/(DefaultStyle.defaultHeight - mainWindow.minimumHeight))*(DefaultStyle.defaultHeight-mainWindow.height))) * DefaultStyle.dp)
|
||||||
spacing: 0
|
spacing: 0
|
||||||
}
|
}
|
||||||
Item {
|
Item {
|
||||||
id: centerLayout
|
id: centerLayout
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: 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 {
|
Image {
|
||||||
id: bottomMountains
|
id: bottomMountains
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,16 @@ AbstractWindow {
|
||||||
title: applicationName
|
title: applicationName
|
||||||
// TODO : handle this bool when security mode is implemented
|
// TODO : handle this bool when security mode is implemented
|
||||||
property bool firstConnection: true
|
property bool firstConnection: true
|
||||||
|
property int initialWidth
|
||||||
|
property int initialHeight
|
||||||
|
Component.onCompleted: {
|
||||||
|
initialWidth = width
|
||||||
|
initialHeight = height
|
||||||
|
}
|
||||||
|
|
||||||
color: DefaultStyle.grey_0
|
color: DefaultStyle.grey_0
|
||||||
// minimumWidth: 1020
|
minimumWidth: Math.round(1020 * DefaultStyle.dp)
|
||||||
// minimumHeight: 700
|
minimumHeight: Math.round(735 * DefaultStyle.dp)
|
||||||
|
|
||||||
signal callCreated()
|
signal callCreated()
|
||||||
property var accountProxy
|
property var accountProxy
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue