contact edition new ui

This commit is contained in:
Gaelle Braud 2024-11-05 10:45:17 +01:00
parent a80f4c1a6e
commit 9797ad70b0
14 changed files with 359 additions and 372 deletions

View file

@ -59,7 +59,7 @@ ColumnLayout {
height: childrenRect.height
}
}
ColumnLayout {
StackLayout {
id: detailLayout
Layout.alignment: Qt.AlignCenter
Layout.topMargin: 30 * DefaultStyle.dp

View file

@ -14,7 +14,6 @@ FocusScope{
property bool enableErrorText: false
property bool errorTextVisible: errorText.text.length > 0
implicitHeight: layout.implicitHeight
implicitWidth: layout.implicitWidth
function clearErrorText() {
errorText.clear()
@ -22,6 +21,8 @@ FocusScope{
ColumnLayout {
id: layout
spacing: 5 * DefaultStyle.dp
anchors.left: parent.left
anchors.right: parent.right
Text {
visible: label.length > 0
@ -41,11 +42,12 @@ FocusScope{
Item {
Layout.preferredHeight: childrenRect.height
Layout.preferredWidth: childrenRect.width
Item {
Layout.fillWidth: true
StackLayout {
id: contentItem
height: childrenRect.height
width: childrenRect.width
anchors.left: parent.left
anchors.right: parent.right
}
TemporaryText {
id: errorText

View file

@ -11,28 +11,30 @@ ColumnLayout {
FormItemLayout {
id: username
Layout.preferredWidth: 346 * DefaultStyle.dp
label: qsTr("Nom d'utilisateur")
mandatory: true
enableErrorText: true
contentItem: TextField {
id: usernameEdit
isError: username.errorTextVisible || errorText.visible
Layout.preferredWidth: 360 * DefaultStyle.dp
Layout.preferredHeight: 49 * DefaultStyle.dp
isError: username.errorTextVisible || errorText.visible
}
}
Item {
Layout.preferredHeight: password.implicitHeight
FormItemLayout {
id: password
width: 346 * DefaultStyle.dp
label: qsTr("Mot de passe")
mandatory: true
enableErrorText: true
contentItem: TextField {
id: passwordEdit
isError: password.errorTextVisible || errorText.visible
Layout.preferredWidth: 360 * DefaultStyle.dp
Layout.preferredHeight: 49 * DefaultStyle.dp
isError: password.errorTextVisible || errorText.visible
hidden: true
}
TemporaryText {

View file

@ -31,6 +31,7 @@ FormItemLayout {
contentItem: TextField {
id: textField
Layout.preferredWidth: 360 * DefaultStyle.dp
placeholderText: useTitleAsPlaceHolder ? mainItem.title : mainItem.placeHolder
initialText: mainItem.propertyOwner[mainItem.propertyName]
customWidth: mainItem.parent.width

View file

@ -20,6 +20,7 @@ Dialog {
bottomPadding: 20 * DefaultStyle.dp
leftPadding: 20 * DefaultStyle.dp
rightPadding: 20 * DefaultStyle.dp
width: 637 * DefaultStyle.dp
content: ColumnLayout {
spacing: 20 * DefaultStyle.dp
id: contentLayout
@ -39,7 +40,6 @@ Dialog {
label: qsTr("Identité")
contentItem: TextField {
enabled: false
customWidth: parent.width
initialText: mainItem.identity
}
}

View file

@ -83,9 +83,9 @@ MainRightPanel {
bannerContent: [
IconLabelButton {
id: addPictureButton
visible: !mainItem.contact || mainItem.contact.core.pictureUri.length === 0
Layout.preferredWidth: width
Layout.preferredHeight: 17 * DefaultStyle.dp
visible: !mainItem.contact || mainItem.contact.core.pictureUri.length === 0
iconSource: AppIcons.camera
iconSize: 17 * DefaultStyle.dp
backgroundColor: "transparent"
@ -133,11 +133,9 @@ MainRightPanel {
Item{Layout.fillWidth: true}
]
content: Flickable {
id: editFlicakble
Layout.fillHeight: true
Layout.fillWidth: true
// width: parent.width
// height: parent.height
id: editionLayout
contentWidth: 421 * DefaultStyle.dp
function ensureVisible(r) {
if (contentY >= r.y)
contentY = r.y;
@ -146,27 +144,23 @@ MainRightPanel {
}
ScrollBar.vertical: Control.ScrollBar {
anchors.right: parent.right
}
ScrollBar.horizontal: Control.ScrollBar {
}
RowLayout {
spacing: 100 * DefaultStyle.dp
// anchors.left: parent.left
// anchors.right: parent.right
ColumnLayout {
spacing: 20 * DefaultStyle.dp
Layout.fillWidth: true
Layout.fillHeight: true
anchors.left: parent.left
anchors.right: parent.right
FormItemLayout {
id: givenName
Layout.fillWidth: true
enableErrorText: true
label: qsTr("Prénom")
Layout.fillWidth: true
contentItem: TextField {
id: givenNameEdit
Layout.fillWidth: true
Layout.preferredHeight: 49 * DefaultStyle.dp
initialText: contact.core.givenName
onTextEdited: contact.core.givenName = text
backgroundColor: DefaultStyle.grey_0
@ -177,6 +171,7 @@ MainRightPanel {
}
FormItemLayout {
label: qsTr("Nom")
Layout.fillWidth: true
contentItem: TextField {
id: nameTextField
initialText: contact.core.familyName
@ -188,6 +183,7 @@ MainRightPanel {
}
FormItemLayout {
label: qsTr("Entreprise")
Layout.fillWidth: true
contentItem: TextField {
id: companyTextField
initialText: contact.core.organization
@ -199,6 +195,7 @@ MainRightPanel {
}
FormItemLayout {
label: qsTr("Fonction")
Layout.fillWidth: true
contentItem: TextField {
id: jobTextField
initialText: contact.core.job
@ -216,15 +213,8 @@ MainRightPanel {
}
}
}
Item{Layout.fillHeight: true}
}
ColumnLayout {
spacing: 20 * DefaultStyle.dp
Layout.fillWidth: true
Layout.fillHeight: true
Repeater {
id: addressesList
Layout.fillWidth: true
onCountChanged: mainItem.addressCount = count
model: VariantList {
model: mainItem.contact && mainItem.contact.core.addresses || []
@ -251,14 +241,14 @@ MainRightPanel {
}
TextField {
id: addressTextField
Layout.preferredWidth: 421 * DefaultStyle.dp
Layout.preferredHeight: height
onEditingFinished: {
if (text.length != 0) mainItem.contact.core.setAddressAt(index, qsTr("Adresse SIP"), text)
}
property string _initialText: modelData.address
initialText: SettingsCpp.onlyDisplaySipUriUsername ? UtilsCpp.getUsername(_initialText) : _initialText
backgroundColor: DefaultStyle.grey_0
Layout.preferredWidth: width
Layout.preferredHeight: height
focus: true
KeyNavigation.right: removeAddressButton
Keys.onPressed: (event) => addressLayout.updateFocus(event)
@ -268,12 +258,12 @@ MainRightPanel {
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
Layout.alignment: Qt.AlignVCenter
background: Item{}
icon.source: AppIcons.closeX
width: 24 * DefaultStyle.dp
height: 24 * DefaultStyle.dp
icon.source: AppIcons.closeX
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
background: Item{}
KeyNavigation.left: addressTextField
Keys.onPressed: (event) => addressLayout.updateFocus(event)
onClicked: mainItem.contact.core.removeAddress(index)
@ -281,11 +271,10 @@ MainRightPanel {
}
}
}
RowLayout {
onYChanged: editFlicakble.ensureVisible(this)
spacing: 10 * DefaultStyle.dp
FormItemLayout {
label: qsTr("Adresse SIP")
Layout.fillWidth: true
onYChanged: editionLayout.ensureVisible(this)
contentItem: TextField {
id: newAddressTextField
backgroundColor: DefaultStyle.grey_0
@ -310,13 +299,7 @@ MainRightPanel {
}
}
}
Item {
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
}
}
Repeater {
// phone numbers
id: phoneNumberList
model: VariantList {
model: mainItem.contact && mainItem.contact.core.phoneNumbers || []
@ -335,7 +318,7 @@ MainRightPanel {
event.accepted = true
}else if(event.key == Qt.Key_Down){
if(index + 1 < phoneNumberList.count)
addressesList.phoneNumberList(index+1).forceActiveFocus()
phoneNumberList.itemAt(index+1).forceActiveFocus()
else
phoneNumberInputTextField.forceActiveFocus()
event.accepted = true
@ -343,26 +326,26 @@ MainRightPanel {
}
TextField {
id: phoneTextField
initialText: modelData.address
onTextEdited: {
if (text.length != 0) mainItem.contact.core.setPhoneNumberAt(index, qsTr("Téléphone"), text)
}
backgroundColor: DefaultStyle.grey_0
Layout.preferredWidth: width
Layout.preferredWidth: 421 * DefaultStyle.dp
Layout.preferredHeight: height
initialText: modelData.address
backgroundColor: DefaultStyle.grey_0
focus: true
KeyNavigation.right: removePhoneButton
Keys.onPressed: (event) => phoneNumberLayout.updateFocus(event)
onEditingFinished: {
if (text.length != 0) mainItem.contact.core.setPhoneNumberAt(index, qsTr("Téléphone"), text)
}
}
Button {
id: removePhoneButton
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
Layout.alignment: Qt.AlignVCenter
background: Item{}
icon.source: AppIcons.closeX
width: 24 * DefaultStyle.dp
height: 24 * DefaultStyle.dp
background: Item{}
icon.source: AppIcons.closeX
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
KeyNavigation.left: phoneTextField
@ -372,12 +355,11 @@ MainRightPanel {
}
}
}
RowLayout {
onYChanged: editFlicakble.ensureVisible(this)
spacing: 10 * DefaultStyle.dp
FormItemLayout {
id: phoneNumberInput
Layout.fillWidth: true
label: qsTr("Phone")
onYChanged: editionLayout.ensureVisible(this)
contentItem: TextField {
id: phoneNumberInputTextField
backgroundColor: DefaultStyle.grey_0
@ -402,21 +384,16 @@ MainRightPanel {
}
}
}
Item {
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
}
}
TemporaryText {
id: addressesErrorText
Layout.fillWidth: true
wrapMode: Text.WordWrap
elide: Text.ElideRight
Layout.fillWidth: true
onTextChanged: editionLayout.ensureVisible(this)
}
Item{Layout.fillHeight: true}
}
}
}
}

View file

@ -82,7 +82,7 @@ LoginLayout {
Component {
id: firstItem
Flickable {
width: contentWidth
width: parent.width
contentWidth: content.implicitWidth
contentHeight: content.implicitHeight
clip: true
@ -188,7 +188,7 @@ LoginLayout {
Component {
id: secondItem
Flickable {
width: contentWidth
width: parent.width
contentWidth: content.implicitWidth
contentHeight: content.implicitHeight
clip: true
@ -196,6 +196,8 @@ LoginLayout {
ColumnLayout {
id: content
spacing: 2 * DefaultStyle.dp
width: 361 * DefaultStyle.dp
ColumnLayout {
spacing: 16 * DefaultStyle.dp
FormItemLayout {
@ -203,6 +205,7 @@ LoginLayout {
label: qsTr("Nom d'utilisateur")
mandatory: true
enableErrorText: true
Layout.fillWidth: true
contentItem: TextField {
id: usernameEdit
isError: username.errorTextVisible
@ -215,6 +218,7 @@ LoginLayout {
label: qsTr("Mot de passe")
mandatory: true
enableErrorText: true
Layout.fillWidth: true
contentItem: TextField {
id: passwordEdit
isError: password.errorTextVisible
@ -229,6 +233,7 @@ LoginLayout {
label: qsTr("Domaine")
mandatory: true
enableErrorText: true
Layout.fillWidth: true
contentItem: TextField {
id: domainEdit
isError: domain.errorTextVisible
@ -246,6 +251,7 @@ LoginLayout {
}
FormItemLayout {
label: qsTr("Nom d'affichage")
Layout.fillWidth: true
contentItem: TextField {
id: displayName
Layout.preferredWidth: 360 * DefaultStyle.dp
@ -256,6 +262,7 @@ LoginLayout {
}
FormItemLayout {
label: qsTr("Transport")
Layout.fillWidth: true
contentItem: ComboBox {
id: transportCbox
height: 49 * DefaultStyle.dp
@ -276,6 +283,7 @@ LoginLayout {
TemporaryText {
id: errorText
Layout.fillWidth: true
Connections {
target: LoginPageCpp
function onErrorMessageChanged(error) {

View file

@ -93,60 +93,62 @@ LoginLayout {
Layout.fillWidth: true
Layout.fillHeight: true
ColumnLayout {
anchors.left: parent.left
anchors.right: parent.right
spacing: 22 * DefaultStyle.dp
ColumnLayout {
spacing: 24 * DefaultStyle.dp
RowLayout {
Layout.preferredHeight: usernameItem.height
spacing: 16 * DefaultStyle.dp
FormItemLayout {
id: usernameItem
label: qsTr("Username")
mandatory: true
enableErrorText: true
Layout.preferredWidth: 346 * DefaultStyle.dp
contentItem: TextField {
id: usernameInput
Layout.preferredWidth: 346 * DefaultStyle.dp
backgroundBorderColor: usernameItem.errorMessage.length > 0 ? DefaultStyle.danger_500main : DefaultStyle.grey_200
}
}
RowLayout {
spacing: 10 * DefaultStyle.dp
Layout.alignment: Qt.AlignBottom
ComboBox {
enabled: false
model: [{text:"@sip.linphone.org"}]
Layout.preferredWidth: 210 * DefaultStyle.dp
Layout.preferredHeight: 49 * DefaultStyle.dp
enabled: false
model: [{text:"@sip.linphone.org"}]
}
EffectImage {
imageSource: AppIcons.lock
colorizationColor: DefaultStyle.main2_600
Layout.preferredWidth: 16 * DefaultStyle.dp
Layout.preferredHeight: 16 * DefaultStyle.dp
imageSource: AppIcons.lock
colorizationColor: DefaultStyle.main2_600
}
}
}
StackLayout {
currentIndex: bar.currentIndex
Layout.fillWidth: true
PhoneNumberInput {
id: phoneNumberInput
Layout.preferredWidth: 346 * DefaultStyle.dp
property string completePhoneNumber: countryCode + phoneNumber
label: qsTr("Numéro de téléphone")
enableErrorText: true
mandatory: true
placeholderText: "Phone number"
defaultCallingCode: "33"
Layout.preferredWidth: 346 * DefaultStyle.dp
}
FormItemLayout {
id: emailItem
Layout.fillWidth: false
Layout.preferredWidth: 346 * DefaultStyle.dp
label: qsTr("Email")
mandatory: true
enableErrorText: true
contentItem: TextField {
id: emailInput
Layout.preferredWidth: 346 * DefaultStyle.dp
backgroundBorderColor: emailItem.errorMessage.length > 0 ? DefaultStyle.danger_500main : DefaultStyle.grey_200
}
}
@ -158,10 +160,9 @@ LoginLayout {
RowLayout {
id: rowlayout
spacing: 16 * DefaultStyle.dp
ColumnLayout {
spacing: 5 * DefaultStyle.dp
FormItemLayout {
id: passwordItem
Layout.preferredWidth: 346 * DefaultStyle.dp
label: qsTr("Mot de passe")
mandatory: true
enableErrorText: true
@ -172,10 +173,8 @@ LoginLayout {
backgroundBorderColor: passwordItem.errorMessage.length > 0 ? DefaultStyle.danger_500main : DefaultStyle.grey_200
}
}
}
ColumnLayout {
spacing: 5 * DefaultStyle.dp
FormItemLayout {
Layout.preferredWidth: 346 * DefaultStyle.dp
label: qsTr("Confirmation mot de passe")
mandatory: true
enableErrorText: true
@ -187,7 +186,6 @@ LoginLayout {
}
}
}
}
TemporaryText {
id: otherErrorText
Layout.fillWidth: true

View file

@ -47,6 +47,7 @@ AbstractSettingsLayout {
Layout.leftMargin: 64 * DefaultStyle.dp
Layout.topMargin: 20 * DefaultStyle.dp
DecoratedTextField {
Layout.fillWidth: true
propertyName: "mwiServerAddress"
propertyOwner: account.core
title: qsTr("URI du serveur de messagerie vocale")
@ -114,6 +115,7 @@ AbstractSettingsLayout {
propertyOwner: account.core
}
DecoratedTextField {
Layout.fillWidth: true
title: qsTr("URL du serveur mandataire")
propertyName: "serverAddress"
propertyOwner: account.core
@ -126,6 +128,7 @@ AbstractSettingsLayout {
propertyOwner: account.core
}
DecoratedTextField {
Layout.fillWidth: true
propertyName: "stunServer"
propertyOwner: account.core
title: qsTr("Adresse du serveur STUN")
@ -148,6 +151,7 @@ AbstractSettingsLayout {
propertyOwner: account.core
}
DecoratedTextField {
Layout.fillWidth: true
propertyName: "expire"
propertyOwner: account.core
title: qsTr("Expiration (en seconde)")
@ -156,6 +160,7 @@ AbstractSettingsLayout {
toValidate: true
}
DecoratedTextField {
Layout.fillWidth: true
title: qsTr("URI de lusine à conversations")
propertyName: "conferenceFactoryAddress"
propertyOwner: account.core
@ -163,6 +168,7 @@ AbstractSettingsLayout {
toValidate: true
}
DecoratedTextField {
Layout.fillWidth: true
title: qsTr("URI de lusine à réunions")
propertyName: "audioVideoConferenceFactoryAddress"
propertyOwner: account.core
@ -171,6 +177,7 @@ AbstractSettingsLayout {
toValidate: true
}
DecoratedTextField {
Layout.fillWidth: true
title: qsTr("URL du serveur déchange de clés de chiffrement")
propertyName: "limeServerUrl"
propertyOwner: account.core

View file

@ -217,7 +217,6 @@ AbstractMainPage {
property: "showDefaultItem"
when: searchBar.text.length != 0
value: false
restoreMode: Binding.RestoreBindingOrValue
}
}
Item {

View file

@ -14,7 +14,7 @@ AbstractMainPage {
newItemIconSource: AppIcons.plusCircle
// disable left panel contact list interaction while a contact is being edited
property bool leftPanelEnabled: true
property bool leftPanelEnabled: !rightPanelStackView.currentItem || rightPanelStackView.currentItem.objectName != "contactEdition"
property FriendGui selectedContact
property string initialFriendToDisplay
@ -551,8 +551,6 @@ AbstractMainPage {
}
]
content: Flickable {
Layout.fillWidth: true
Layout.fillHeight: true
contentWidth: parent.width
ColumnLayout {
spacing: 32 * DefaultStyle.dp
@ -912,8 +910,6 @@ AbstractMainPage {
id: contactEdition
ContactEdition {
property string objectName: "contactEdition"
Control.StackView.onActivated: mainItem.leftPanelEnabled = false
Control.StackView.onDeactivated: mainItem.leftPanelEnabled = true
onCloseEdition: {
if (rightPanelStackView.depth <= 1) rightPanelStackView.clear()
else rightPanelStackView.pop(Control.StackView.Immediate)

View file

@ -172,7 +172,6 @@ AbstractMainPage {
property: "showDefaultItem"
when: searchBar.text.length !== 0
value: false
restoreMode: Binding.RestoreBindingOrValue
}
}
Text {

View file

@ -960,14 +960,12 @@ AbstractWindow {
when: middleItemStackView.currentItem.objectName === "waitingRoom"
property: "imageSource"
value: AppIcons.usersThree
restoreMode: Binding.RestoreBindingOrValue
}
Binding {
target: callStatusText
when: middleItemStackView.currentItem.objectName === "waitingRoom"
property: "text"
value: waitingRoomIn.conferenceInfo ? waitingRoomIn.conferenceInfo.core.subject : ''
restoreMode: Binding.RestoreBindingOrValue
}
Binding {
target: conferenceDate