meeting creation/ sip login page margins, typography
This commit is contained in:
gaelle.braud 2025-09-17 11:17:31 +02:00 committed by Gaelle Braud
parent 4541ee3079
commit 77da7183f4
6 changed files with 1357 additions and 1307 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -79,7 +79,7 @@ LoginLayout {
Component { Component {
id: firstItem id: firstItem
Flickable { Flickable {
width: parent.width width: Math.round(361 * DefaultStyle.dp)
contentWidth: content.implicitWidth contentWidth: content.implicitWidth
contentHeight: content.implicitHeight contentHeight: content.implicitHeight
clip: true clip: true
@ -107,28 +107,7 @@ LoginLayout {
} }
text: qsTr("Certaines fonctionnalités telles que les conversations de groupe, les vidéo-conférences, etc… nécessitent un compte %1.\n\nCes fonctionnalités seront masquées si vous utilisez un compte SIP tiers.\n\nPour les activer dans un projet commercial, merci de nous contacter.").arg(applicationName) text: qsTr("Certaines fonctionnalités telles que les conversations de groupe, les vidéo-conférences, etc… nécessitent un compte %1.\n\nCes fonctionnalités seront masquées si vous utilisez un compte SIP tiers.\n\nPour les activer dans un projet commercial, merci de nous contacter.").arg(applicationName)
} }
// Text {
// Layout.fillWidth: true
// Layout.preferredWidth: rootStackView.width
// wrapMode: Text.WordWrap
// color: DefaultStyle.main2_900
// font {
// pixelSize: Typography.p1.pixelSize
// weight: Typography.p1.weight
// }
// text:"Ces fonctionnalités sont cachées lorsque vous vous enregistrez avec un compte SIP tiers."
// }
// Text {
// Layout.fillWidth: true
// Layout.preferredWidth: rootStackView.width
// wrapMode: Text.WordWrap
// color: DefaultStyle.main2_900
// font {
// pixelSize: Typography.p1.pixelSize
// weight: Typography.p1.weight
// }
// text: "Pour les activer dans un projet commercial, veuillez nous contacter. "
// }
} }
SmallButton { SmallButton {
id: openLinkButton id: openLinkButton
@ -180,7 +159,7 @@ LoginLayout {
id: secondItem id: secondItem
Flickable { Flickable {
id: formFlickable id: formFlickable
width: parent.width width: Math.round(770 * DefaultStyle.dp)
contentWidth: content.implicitWidth contentWidth: content.implicitWidth
contentHeight: content.implicitHeight contentHeight: content.implicitHeight
clip: true clip: true
@ -188,212 +167,252 @@ LoginLayout {
Control.ScrollBar.vertical: scrollbar Control.ScrollBar.vertical: scrollbar
ColumnLayout { RowLayout {
id: content id: content
spacing: Math.round(2 * DefaultStyle.dp) width: formFlickable.width - scrollbar.width*2
width: formFlickable.width - scrollbar.width*2
ColumnLayout { ColumnLayout {
spacing: Math.round(8 * DefaultStyle.dp) spacing: Math.round(2 * DefaultStyle.dp)
FormItemLayout { Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
id: username Layout.fillHeight: true
//: "Nom d'utilisateur" ColumnLayout {
label: qsTr("username") spacing: Math.round(8 * DefaultStyle.dp)
mandatory: true FormItemLayout {
enableErrorText: true id: username
Layout.fillWidth: true //: "Nom d'utilisateur"
contentItem: TextField { label: qsTr("username")
id: usernameEdit mandatory: true
isError: username.errorTextVisible || errorText.isVisible enableErrorText: true
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp) Layout.fillWidth: true
KeyNavigation.down: passwordEdit contentItem: TextField {
id: usernameEdit
isError: username.errorTextVisible || errorText.isVisible
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
KeyNavigation.down: passwordEdit
}
} }
} FormItemLayout {
FormItemLayout { id: password
id: password label: qsTr("password")
label: qsTr("password") mandatory: true
mandatory: true enableErrorText: true
enableErrorText: true Layout.fillWidth: true
Layout.fillWidth: true contentItem: TextField {
contentItem: TextField { id: passwordEdit
id: passwordEdit isError: password.errorTextVisible || errorText.isVisible
isError: password.errorTextVisible || errorText.isVisible hidden: true
hidden: true Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp) KeyNavigation.up: usernameEdit
KeyNavigation.up: usernameEdit KeyNavigation.down: domainEdit
KeyNavigation.down: domainEdit }
} }
} FormItemLayout {
FormItemLayout { id: domain
id: domain //: "Domaine"
//: "Domaine" label: qsTr("sip_address_domain")
label: qsTr("sip_address_domain") mandatory: true
mandatory: true enableErrorText: true
enableErrorText: true Layout.fillWidth: true
Layout.fillWidth: true contentItem: TextField {
contentItem: TextField { id: domainEdit
id: domainEdit isError: domain.errorTextVisible
isError: domain.errorTextVisible initialText: SettingsCpp.assistantThirdPartySipAccountDomain
initialText: SettingsCpp.assistantThirdPartySipAccountDomain Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp) KeyNavigation.up: passwordEdit
KeyNavigation.up: passwordEdit KeyNavigation.down: displayName
KeyNavigation.down: displayName }
Connections {
target: SettingsCpp
function onAssistantThirdPartySipAccountDomainChanged() {
domainEdit.resetText()
}
}
} }
Connections { FormItemLayout {
target: SettingsCpp //: Nom d'affichage
function onAssistantThirdPartySipAccountDomainChanged() { label: qsTr("sip_address_display_name")
domainEdit.resetText() Layout.fillWidth: true
contentItem: TextField {
id: displayName
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
KeyNavigation.up: domainEdit
KeyNavigation.down: transportCbox
}
}
FormItemLayout {
//: "Transport"
label: qsTr("transport")
Layout.fillWidth: true
contentItem: ComboBox {
id: transportCbox
height: Math.round(49 * DefaultStyle.dp)
width: Math.round(360 * DefaultStyle.dp)
textRole: "text"
valueRole: "value"
model: [
{text: "TCP", value: LinphoneEnums.TransportType.Tcp},
{text: "UDP", value: LinphoneEnums.TransportType.Udp},
{text: "TLS", value: LinphoneEnums.TransportType.Tls},
{text: "DTLS", value: LinphoneEnums.TransportType.Dtls}
]
currentIndex: Utils.findIndex(model, function (entry) {
return entry.text === SettingsCpp.assistantThirdPartySipAccountTransport.toUpperCase()
})
} }
} }
} }
FormItemLayout {
//: Nom d'affichage TemporaryText {
label: qsTr("sip_address_display_name") id: errorText
Layout.fillWidth: true Layout.fillWidth: true
contentItem: TextField {
id: displayName
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
KeyNavigation.up: domainEdit
KeyNavigation.down: transportCbox
}
}
FormItemLayout {
//: "Transport"
label: qsTr("transport")
Layout.fillWidth: true
contentItem: ComboBox {
id: transportCbox
height: Math.round(49 * DefaultStyle.dp)
width: Math.round(360 * DefaultStyle.dp)
textRole: "text"
valueRole: "value"
model: [
{text: "TCP", value: LinphoneEnums.TransportType.Tcp},
{text: "UDP", value: LinphoneEnums.TransportType.Udp},
{text: "TLS", value: LinphoneEnums.TransportType.Tls},
{text: "DTLS", value: LinphoneEnums.TransportType.Dtls}
]
currentIndex: Utils.findIndex(model, function (entry) {
return entry.text === SettingsCpp.assistantThirdPartySipAccountTransport.toUpperCase()
})
}
}
}
TemporaryText {
id: errorText
Layout.fillWidth: true
Connections {
target: LoginPageCpp
function onErrorMessageChanged(error) {
errorText.setText(error)
}
}
}
BigButton {
id: connectionButton
Layout.topMargin: Math.round(15 * DefaultStyle.dp)
style: ButtonStyle.main
contentItem: StackLayout {
id: connectionButtonContent
currentIndex: 0
Text {
text: qsTr("assistant_account_login")
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font {
pixelSize: Typography.b1.pixelSize
weight: Typography.b1.weight
}
color: DefaultStyle.grey_0
}
BusyIndicator {
implicitWidth: parent.height
implicitHeight: parent.height
Layout.alignment: Qt.AlignCenter
indicatorColor: DefaultStyle.grey_0
}
Connections { Connections {
target: LoginPageCpp target: LoginPageCpp
function onRegistrationStateChanged() {
if (LoginPageCpp.registrationState != LinphoneEnums.RegistrationState.Progress) {
connectionButton.enabled = true
connectionButtonContent.currentIndex = 0
}
}
function onErrorMessageChanged(error) { function onErrorMessageChanged(error) {
if (error.length != 0) { errorText.setText(error)
connectionButton.enabled = true }
connectionButtonContent.currentIndex = 0 }
}
BigButton {
id: connectionButton
Layout.topMargin: Math.round(15 * DefaultStyle.dp)
style: ButtonStyle.main
contentItem: StackLayout {
id: connectionButtonContent
currentIndex: 0
Text {
text: qsTr("assistant_account_login")
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font {
pixelSize: Typography.b1.pixelSize
weight: Typography.b1.weight
}
color: DefaultStyle.grey_0
}
BusyIndicator {
implicitWidth: parent.height
implicitHeight: parent.height
Layout.alignment: Qt.AlignCenter
indicatorColor: DefaultStyle.grey_0
}
Connections {
target: LoginPageCpp
function onRegistrationStateChanged() {
if (LoginPageCpp.registrationState != LinphoneEnums.RegistrationState.Progress) {
connectionButton.enabled = true
connectionButtonContent.currentIndex = 0
}
}
function onErrorMessageChanged(error) {
if (error.length != 0) {
connectionButton.enabled = true
connectionButtonContent.currentIndex = 0
}
} }
} }
} }
}
function trigger() { function trigger() {
username.errorMessage = "" username.errorMessage = ""
password.errorMessage = "" password.errorMessage = ""
domain.errorMessage = "" domain.errorMessage = ""
errorText.clear() errorText.clear()
loginDelay.restart() loginDelay.restart()
}
onPressed: trigger()
KeyNavigation.up: transportCbox
Timer{
id: loginDelay
interval: 200
onTriggered: {
if (usernameEdit.text.length == 0 || passwordEdit.text.length == 0 || domainEdit.text.length == 0) {
if (usernameEdit.text.length == 0)
username.errorMessage = qsTr("assistant_account_login_missing_username")
if (passwordEdit.text.length == 0)
password.errorMessage = qsTr("assistant_account_login_missing_password")
if (domainEdit.text.length == 0)
//: "Veuillez saisir un nom de domaine
domain.errorMessage = qsTr("assistant_account_login_missing_domain")
return
}
console.debug("[SIPLoginPage] User: Log in")
LoginPageCpp.login(usernameEdit.text, passwordEdit.text, displayName.text, domainEdit.text, transportCbox.currentValue);
connectionButton.enabled = false
connectionButtonContent.currentIndex = 1
} }
onPressed: trigger()
KeyNavigation.up: transportCbox
Timer{
id: loginDelay
interval: 200
onTriggered: {
if (usernameEdit.text.length == 0 || passwordEdit.text.length == 0 || domainEdit.text.length == 0) {
if (usernameEdit.text.length == 0)
username.errorMessage = qsTr("assistant_account_login_missing_username")
if (passwordEdit.text.length == 0)
password.errorMessage = qsTr("assistant_account_login_missing_password")
if (domainEdit.text.length == 0)
//: "Veuillez saisir un nom de domaine
domain.errorMessage = qsTr("assistant_account_login_missing_domain")
return
}
console.debug("[SIPLoginPage] User: Log in")
LoginPageCpp.login(usernameEdit.text, passwordEdit.text, displayName.text, domainEdit.text, transportCbox.currentValue);
connectionButton.enabled = false
connectionButtonContent.currentIndex = 1
}
}
}
Item {
Layout.fillHeight: true
} }
} }
Item { ColumnLayout {
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
Layout.fillHeight: true Layout.fillHeight: true
spacing: Math.round(8 * DefaultStyle.dp)
FormItemLayout {
id: serverAddress
//: "URL du serveur mandataire"
label: qsTr("login_server_address")
Layout.fillWidth: true
contentItem: TextField {
id: serverAddressEdit
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
KeyNavigation.down: connectionIdEdit
}
}
FormItemLayout {
id: connectionId
//: "Identifiant de connexion (si différent)"
label: qsTr("login_server_address")
Layout.fillWidth: true
contentItem: TextField {
id: connectionIdEdit
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
KeyNavigation.up: serverAddressEdit
}
}
Item{Layout.fillHeight: true}
} }
} }
} }
} }
centerContent: [ centerContent: [
Item { ScrollBar {
anchors.fill: parent id: scrollbar
Control.StackView { z: 1
id: rootStackView active: true
initialItem: SettingsCpp.assistantGoDirectlyToThirdPartySipAccountLogin ? secondItem : firstItem interactive: true
anchors.top: parent.top parent: rootStackView.currentItem
anchors.left: parent.left // visible: parent.contentHeight > parent.height
anchors.bottom: parent.bottom policy: Control.ScrollBar.AsNeeded
anchors.leftMargin: Math.round(127 * DefaultStyle.dp) anchors.top: parent.top
width: Math.round(361 * DefaultStyle.dp) anchors.bottom: parent.bottom
} anchors.left: parent.left
ScrollBar { // Layout.leftMargin: Math.round(119 * DefaultStyle.dp)
id: scrollbar // anchors.leftMargin: Math.round(119 * DefaultStyle.dp)
z: 1 // anchors.rightMargin: -8 * DefaultStyle.dp
active: true },
interactive: true Control.StackView {
parent: rootStackView.currentItem id: rootStackView
visible: parent.contentHeight > parent.height initialItem: SettingsCpp.assistantGoDirectlyToThirdPartySipAccountLogin ? secondItem : firstItem
policy: Control.ScrollBar.AsNeeded anchors.left: parent.left
anchors.rightMargin: -8 * DefaultStyle.dp anchors.top: parent.top
} anchors.bottom: parent.bottom
}, anchors.leftMargin: Math.round(127 * DefaultStyle.dp)
width: currentItem ? currentItem.width : 0
},
// Item {
// id: sipItem
// // spacing: Math.round(8 * Defaultstyle.dp)
// anchors.fill: parent
// anchors.rightMargin: Math.round(50 * DefaultStyle.dp) + image.width
// },
Image { Image {
id: image
z: -1 z: -1
anchors.top: parent.top anchors.top: parent.top
anchors.right: parent.right anchors.right: parent.right

View file

@ -53,8 +53,8 @@ ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredWidth: implicitWidth Layout.preferredWidth: implicitWidth
model: mainItem.tabbarModel model: mainItem.tabbarModel
pixelSize: Typography.h3m.pixelSize pixelSize: Typography.h4.pixelSize
textWeight: Typography.h3m.weight textWeight: Typography.h4.weight
spacing: Math.round(10 * DefaultStyle.dp) spacing: Math.round(10 * DefaultStyle.dp)
} }

View file

@ -287,8 +287,8 @@ AbstractMainPage {
spacing: Math.round(33 * DefaultStyle.dp) spacing: Math.round(33 * DefaultStyle.dp)
anchors.fill: parent anchors.fill: parent
RowLayout { RowLayout {
Layout.rightMargin: Math.round(35 * DefaultStyle.dp)
spacing: Math.round(5 * DefaultStyle.dp) spacing: Math.round(5 * DefaultStyle.dp)
Layout.rightMargin: Math.round(35 * DefaultStyle.dp)
Button { Button {
id: backButton id: backButton
style: ButtonStyle.noBackground style: ButtonStyle.noBackground
@ -345,15 +345,19 @@ AbstractMainPage {
Layout.fillWidth: true Layout.fillWidth: true
contentHeight: meetingSetup.height contentHeight: meetingSetup.height
Control.ScrollBar.vertical: ScrollBar { Control.ScrollBar.vertical: ScrollBar {
id: meetingScrollBar
visible: parent.contentHeight > parent.height visible: parent.contentHeight > parent.height
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: Math.round(8 * DefaultStyle.dp)
} }
contentChildren: MeetingForm { MeetingForm {
id: meetingSetup id: meetingSetup
conferenceInfoGui: createConfLayout.conferenceInfoGui conferenceInfoGui: createConfLayout.conferenceInfoGui
isCreation: true isCreation: true
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: Math.round(35 * DefaultStyle.dp) anchors.rightMargin: Math.round(35 * DefaultStyle.dp)
Connections { Connections {
target: meetingSetup.conferenceInfoGui ? meetingSetup.conferenceInfoGui.core : null target: meetingSetup.conferenceInfoGui ? meetingSetup.conferenceInfoGui.core : null