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 height: childrenRect.height
} }
} }
ColumnLayout { StackLayout {
id: detailLayout id: detailLayout
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.topMargin: 30 * DefaultStyle.dp Layout.topMargin: 30 * DefaultStyle.dp

View file

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

View file

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

View file

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

View file

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

View file

@ -83,9 +83,9 @@ MainRightPanel {
bannerContent: [ bannerContent: [
IconLabelButton { IconLabelButton {
id: addPictureButton id: addPictureButton
visible: !mainItem.contact || mainItem.contact.core.pictureUri.length === 0
Layout.preferredWidth: width Layout.preferredWidth: width
Layout.preferredHeight: 17 * DefaultStyle.dp Layout.preferredHeight: 17 * DefaultStyle.dp
visible: !mainItem.contact || mainItem.contact.core.pictureUri.length === 0
iconSource: AppIcons.camera iconSource: AppIcons.camera
iconSize: 17 * DefaultStyle.dp iconSize: 17 * DefaultStyle.dp
backgroundColor: "transparent" backgroundColor: "transparent"
@ -133,11 +133,9 @@ MainRightPanel {
Item{Layout.fillWidth: true} Item{Layout.fillWidth: true}
] ]
content: Flickable { content: Flickable {
id: editFlicakble id: editionLayout
Layout.fillHeight: true contentWidth: 421 * DefaultStyle.dp
Layout.fillWidth: true
// width: parent.width
// height: parent.height
function ensureVisible(r) { function ensureVisible(r) {
if (contentY >= r.y) if (contentY >= r.y)
contentY = r.y; contentY = r.y;
@ -146,275 +144,254 @@ MainRightPanel {
} }
ScrollBar.vertical: Control.ScrollBar { ScrollBar.vertical: Control.ScrollBar {
anchors.right: parent.right
} }
ScrollBar.horizontal: Control.ScrollBar { ScrollBar.horizontal: Control.ScrollBar {
} }
ColumnLayout {
spacing: 20 * DefaultStyle.dp
anchors.left: parent.left
anchors.right: parent.right
RowLayout { FormItemLayout {
spacing: 100 * DefaultStyle.dp id: givenName
// anchors.left: parent.left
// anchors.right: parent.right
ColumnLayout {
spacing: 20 * DefaultStyle.dp
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true enableErrorText: true
label: qsTr("Prénom")
FormItemLayout { contentItem: TextField {
id: givenName id: givenNameEdit
enableErrorText: true Layout.preferredHeight: 49 * DefaultStyle.dp
label: qsTr("Prénom") initialText: contact.core.givenName
Layout.fillWidth: true onTextEdited: contact.core.givenName = text
contentItem: TextField { backgroundColor: DefaultStyle.grey_0
id: givenNameEdit backgroundBorderColor: givenName.errorTextVisible ? DefaultStyle.danger_500main : DefaultStyle.grey_200
Layout.fillWidth: true KeyNavigation.up: editButton.visible ? editButton : addPictureButton
initialText: contact.core.givenName KeyNavigation.down: nameTextField
onTextEdited: contact.core.givenName = text }
backgroundColor: DefaultStyle.grey_0 }
backgroundBorderColor: givenName.errorTextVisible ? DefaultStyle.danger_500main : DefaultStyle.grey_200 FormItemLayout {
KeyNavigation.up: editButton.visible ? editButton : addPictureButton label: qsTr("Nom")
KeyNavigation.down: nameTextField Layout.fillWidth: true
contentItem: TextField {
id: nameTextField
initialText: contact.core.familyName
onTextEdited: contact.core.familyName = text
backgroundColor: DefaultStyle.grey_0
KeyNavigation.up: givenNameEdit
KeyNavigation.down: companyTextField
}
}
FormItemLayout {
label: qsTr("Entreprise")
Layout.fillWidth: true
contentItem: TextField {
id: companyTextField
initialText: contact.core.organization
onTextEdited: contact.core.organization = text
backgroundColor: DefaultStyle.grey_0
KeyNavigation.up: nameTextField
KeyNavigation.down: jobTextField
}
}
FormItemLayout {
label: qsTr("Fonction")
Layout.fillWidth: true
contentItem: TextField {
id: jobTextField
initialText: contact.core.job
onTextEdited: contact.core.job = text
backgroundColor: DefaultStyle.grey_0
KeyNavigation.up: companyTextField
Keys.onPressed: (event) => {
if(event.key == Qt.Key_Down){
if(addressesList.count > 0)
addressesList.itemAt(0).forceActiveFocus()
else
newAddressTextField.forceActiveFocus()
event.accepted = true
}
} }
} }
FormItemLayout { }
label: qsTr("Nom") Repeater {
contentItem: TextField { id: addressesList
id: nameTextField onCountChanged: mainItem.addressCount = count
initialText: contact.core.familyName model: VariantList {
onTextEdited: contact.core.familyName = text model: mainItem.contact && mainItem.contact.core.addresses || []
backgroundColor: DefaultStyle.grey_0
KeyNavigation.up: givenNameEdit
KeyNavigation.down: companyTextField
}
} }
FormItemLayout { delegate: FormItemLayout {
label: qsTr("Entreprise") label: modelData.label
contentItem: TextField { contentItem: RowLayout {
id: companyTextField id: addressLayout
initialText: contact.core.organization spacing: 10 * DefaultStyle.dp
onTextEdited: contact.core.organization = text function updateFocus(event){
backgroundColor: DefaultStyle.grey_0 if(event.key == Qt.Key_Up){
KeyNavigation.up: nameTextField if(index - 1 >=0 )
KeyNavigation.down: jobTextField addressesList.itemAt(index - 1).forceActiveFocus()
} else
} jobTextField.forceActiveFocus()
FormItemLayout { event.accepted = true
label: qsTr("Fonction") }else if(event.key == Qt.Key_Down){
contentItem: TextField { if(index + 1 < addressesList.count)
id: jobTextField addressesList.itemAt(index+1).forceActiveFocus()
initialText: contact.core.job
onTextEdited: contact.core.job = text
backgroundColor: DefaultStyle.grey_0
KeyNavigation.up: companyTextField
Keys.onPressed: (event) => {
if(event.key == Qt.Key_Down){
if(addressesList.count > 0)
addressesList.itemAt(0).forceActiveFocus()
else else
newAddressTextField.forceActiveFocus() newAddressTextField.forceActiveFocus()
event.accepted = true event.accepted = true
} }
} }
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
focus: true
KeyNavigation.right: removeAddressButton
Keys.onPressed: (event) => addressLayout.updateFocus(event)
}
Button {
id: removeAddressButton
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
Layout.alignment: Qt.AlignVCenter
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)
}
} }
} }
Item{Layout.fillHeight: true}
} }
ColumnLayout { FormItemLayout {
spacing: 20 * DefaultStyle.dp label: qsTr("Adresse SIP")
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true onYChanged: editionLayout.ensureVisible(this)
Repeater { contentItem: TextField {
id: addressesList id: newAddressTextField
Layout.fillWidth: true backgroundColor: DefaultStyle.grey_0
onCountChanged: mainItem.addressCount = count Keys.onPressed: (event) => {
model: VariantList { if(event.key == Qt.Key_Up){
model: mainItem.contact && mainItem.contact.core.addresses || [] if(addressesList.count > 0 )
} addressesList.itemAt(addressesList.count - 1).forceActiveFocus()
delegate: FormItemLayout { else
label: modelData.label jobTextField.forceActiveFocus()
contentItem: RowLayout { event.accepted = true
id: addressLayout }else if(event.key == Qt.Key_Down){
spacing: 10 * DefaultStyle.dp if(phoneNumberList.count > 0)
function updateFocus(event){ phoneNumberList.itemAt(0).forceActiveFocus()
if(event.key == Qt.Key_Up){ else
if(index - 1 >=0 ) phoneNumberInputTextField.forceActiveFocus()
addressesList.itemAt(index - 1).forceActiveFocus() event.accepted = true
else
jobTextField.forceActiveFocus()
event.accepted = true
}else if(event.key == Qt.Key_Down){
if(index + 1 < addressesList.count)
addressesList.itemAt(index+1).forceActiveFocus()
else
newAddressTextField.forceActiveFocus()
event.accepted = true
}
}
TextField {
id: addressTextField
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)
}
Button {
id: removeAddressButton
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.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
KeyNavigation.left: addressTextField
Keys.onPressed: (event) => addressLayout.updateFocus(event)
onClicked: mainItem.contact.core.removeAddress(index)
}
} }
} }
} onEditingFinished: {
RowLayout { mainItem.contact.core.appendAddress(text)
onYChanged: editFlicakble.ensureVisible(this) newAddressTextField.clear()
spacing: 10 * DefaultStyle.dp
FormItemLayout {
label: qsTr("Adresse SIP")
contentItem: TextField {
id: newAddressTextField
backgroundColor: DefaultStyle.grey_0
Keys.onPressed: (event) => {
if(event.key == Qt.Key_Up){
if(addressesList.count > 0 )
addressesList.itemAt(addressesList.count - 1).forceActiveFocus()
else
jobTextField.forceActiveFocus()
event.accepted = true
}else if(event.key == Qt.Key_Down){
if(phoneNumberList.count > 0)
phoneNumberList.itemAt(0).forceActiveFocus()
else
phoneNumberInputTextField.forceActiveFocus()
event.accepted = true
}
}
onEditingFinished: {
mainItem.contact.core.appendAddress(text)
newAddressTextField.clear()
}
}
}
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 || []
}
delegate: FormItemLayout {
label: modelData.label
contentItem: RowLayout {
id: phoneNumberLayout
spacing: 10 * DefaultStyle.dp
function updateFocus(event){
if(event.key == Qt.Key_Up){
if(index - 1 >=0 )
phoneNumberList.itemAt(index - 1).forceActiveFocus()
else
newAddressTextField.forceActiveFocus()
event.accepted = true
}else if(event.key == Qt.Key_Down){
if(index + 1 < phoneNumberList.count)
addressesList.phoneNumberList(index+1).forceActiveFocus()
else
phoneNumberInputTextField.forceActiveFocus()
event.accepted = true
}
}
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.preferredHeight: height
focus: true
KeyNavigation.right: removePhoneButton
Keys.onPressed: (event) => phoneNumberLayout.updateFocus(event)
}
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
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
KeyNavigation.left: phoneTextField
Keys.onPressed: (event) => phoneNumberLayout.updateFocus(event)
onClicked: mainItem.contact.core.removePhoneNumber(index)
}
}
}
}
RowLayout {
onYChanged: editFlicakble.ensureVisible(this)
spacing: 10 * DefaultStyle.dp
FormItemLayout {
id: phoneNumberInput
label: qsTr("Phone")
contentItem: TextField {
id: phoneNumberInputTextField
backgroundColor: DefaultStyle.grey_0
Keys.onPressed: (event) => {
if(event.key == Qt.Key_Up){
if(phoneNumberList.count > 0 )
phoneNumberList.itemAt(phoneNumberList.count - 1).forceActiveFocus()
else
newAddressTextField.forceActiveFocus()
event.accepted = true
}else if(event.key == Qt.Key_Down){
if(saveButton.enabled)
saveButton.forceActiveFocus()
else
givenNameEdit.forceActiveFocus()
event.accepted = true
}
}
onEditingFinished: {
if (text.length != 0) mainItem.contact.core.appendPhoneNumber(phoneNumberInput.label, text)
text = ""
}
}
}
Item {
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
}
}
TemporaryText {
id: addressesErrorText
wrapMode: Text.WordWrap
elide: Text.ElideRight
Layout.fillWidth: true
}
Item{Layout.fillHeight: true}
} }
Repeater {
id: phoneNumberList
model: VariantList {
model: mainItem.contact && mainItem.contact.core.phoneNumbers || []
}
delegate: FormItemLayout {
label: modelData.label
contentItem: RowLayout {
id: phoneNumberLayout
spacing: 10 * DefaultStyle.dp
function updateFocus(event){
if(event.key == Qt.Key_Up){
if(index - 1 >=0 )
phoneNumberList.itemAt(index - 1).forceActiveFocus()
else
newAddressTextField.forceActiveFocus()
event.accepted = true
}else if(event.key == Qt.Key_Down){
if(index + 1 < phoneNumberList.count)
phoneNumberList.itemAt(index+1).forceActiveFocus()
else
phoneNumberInputTextField.forceActiveFocus()
event.accepted = true
}
}
TextField {
id: phoneTextField
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
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
Keys.onPressed: (event) => phoneNumberLayout.updateFocus(event)
onClicked: mainItem.contact.core.removePhoneNumber(index)
}
}
}
}
FormItemLayout {
id: phoneNumberInput
Layout.fillWidth: true
label: qsTr("Phone")
onYChanged: editionLayout.ensureVisible(this)
contentItem: TextField {
id: phoneNumberInputTextField
backgroundColor: DefaultStyle.grey_0
Keys.onPressed: (event) => {
if(event.key == Qt.Key_Up){
if(phoneNumberList.count > 0 )
phoneNumberList.itemAt(phoneNumberList.count - 1).forceActiveFocus()
else
newAddressTextField.forceActiveFocus()
event.accepted = true
}else if(event.key == Qt.Key_Down){
if(saveButton.enabled)
saveButton.forceActiveFocus()
else
givenNameEdit.forceActiveFocus()
event.accepted = true
}
}
onEditingFinished: {
if (text.length != 0) mainItem.contact.core.appendPhoneNumber(phoneNumberInput.label, text)
text = ""
}
}
}
TemporaryText {
id: addressesErrorText
Layout.fillWidth: true
wrapMode: Text.WordWrap
elide: Text.ElideRight
onTextChanged: editionLayout.ensureVisible(this)
}
Item{Layout.fillHeight: true}
} }
} }

View file

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

View file

@ -93,60 +93,62 @@ LoginLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
ColumnLayout { ColumnLayout {
anchors.left: parent.left
anchors.right: parent.right
spacing: 22 * DefaultStyle.dp spacing: 22 * DefaultStyle.dp
ColumnLayout { ColumnLayout {
spacing: 24 * DefaultStyle.dp spacing: 24 * DefaultStyle.dp
RowLayout { RowLayout {
Layout.preferredHeight: usernameItem.height
spacing: 16 * DefaultStyle.dp spacing: 16 * DefaultStyle.dp
FormItemLayout { FormItemLayout {
id: usernameItem id: usernameItem
label: qsTr("Username") label: qsTr("Username")
mandatory: true mandatory: true
enableErrorText: true enableErrorText: true
Layout.preferredWidth: 346 * DefaultStyle.dp
contentItem: TextField { contentItem: TextField {
id: usernameInput id: usernameInput
Layout.preferredWidth: 346 * DefaultStyle.dp
backgroundBorderColor: usernameItem.errorMessage.length > 0 ? DefaultStyle.danger_500main : DefaultStyle.grey_200 backgroundBorderColor: usernameItem.errorMessage.length > 0 ? DefaultStyle.danger_500main : DefaultStyle.grey_200
} }
} }
RowLayout { RowLayout {
spacing: 10 * DefaultStyle.dp spacing: 10 * DefaultStyle.dp
Layout.alignment: Qt.AlignBottom
ComboBox { ComboBox {
enabled: false
model: [{text:"@sip.linphone.org"}]
Layout.preferredWidth: 210 * DefaultStyle.dp Layout.preferredWidth: 210 * DefaultStyle.dp
Layout.preferredHeight: 49 * DefaultStyle.dp Layout.preferredHeight: 49 * DefaultStyle.dp
enabled: false
model: [{text:"@sip.linphone.org"}]
} }
EffectImage { EffectImage {
imageSource: AppIcons.lock
colorizationColor: DefaultStyle.main2_600
Layout.preferredWidth: 16 * DefaultStyle.dp Layout.preferredWidth: 16 * DefaultStyle.dp
Layout.preferredHeight: 16 * DefaultStyle.dp Layout.preferredHeight: 16 * DefaultStyle.dp
imageSource: AppIcons.lock
colorizationColor: DefaultStyle.main2_600
} }
} }
} }
StackLayout { StackLayout {
currentIndex: bar.currentIndex currentIndex: bar.currentIndex
Layout.fillWidth: true
PhoneNumberInput { PhoneNumberInput {
id: phoneNumberInput id: phoneNumberInput
Layout.preferredWidth: 346 * DefaultStyle.dp
property string completePhoneNumber: countryCode + phoneNumber property string completePhoneNumber: countryCode + phoneNumber
label: qsTr("Numéro de téléphone") label: qsTr("Numéro de téléphone")
enableErrorText: true enableErrorText: true
mandatory: true mandatory: true
placeholderText: "Phone number" placeholderText: "Phone number"
defaultCallingCode: "33" defaultCallingCode: "33"
Layout.preferredWidth: 346 * DefaultStyle.dp
} }
FormItemLayout { FormItemLayout {
id: emailItem id: emailItem
Layout.fillWidth: false
Layout.preferredWidth: 346 * DefaultStyle.dp
label: qsTr("Email") label: qsTr("Email")
mandatory: true mandatory: true
enableErrorText: true enableErrorText: true
contentItem: TextField { contentItem: TextField {
id: emailInput id: emailInput
Layout.preferredWidth: 346 * DefaultStyle.dp
backgroundBorderColor: emailItem.errorMessage.length > 0 ? DefaultStyle.danger_500main : DefaultStyle.grey_200 backgroundBorderColor: emailItem.errorMessage.length > 0 ? DefaultStyle.danger_500main : DefaultStyle.grey_200
} }
} }
@ -158,33 +160,29 @@ LoginLayout {
RowLayout { RowLayout {
id: rowlayout id: rowlayout
spacing: 16 * DefaultStyle.dp spacing: 16 * DefaultStyle.dp
ColumnLayout { FormItemLayout {
spacing: 5 * DefaultStyle.dp id: passwordItem
FormItemLayout { Layout.preferredWidth: 346 * DefaultStyle.dp
id: passwordItem label: qsTr("Mot de passe")
label: qsTr("Mot de passe") mandatory: true
mandatory: true enableErrorText: true
enableErrorText: true contentItem: TextField {
contentItem: TextField { id: pwdInput
id: pwdInput hidden: true
hidden: true Layout.preferredWidth: 346 * DefaultStyle.dp
Layout.preferredWidth: 346 * DefaultStyle.dp backgroundBorderColor: passwordItem.errorMessage.length > 0 ? DefaultStyle.danger_500main : DefaultStyle.grey_200
backgroundBorderColor: passwordItem.errorMessage.length > 0 ? DefaultStyle.danger_500main : DefaultStyle.grey_200
}
} }
} }
ColumnLayout { FormItemLayout {
spacing: 5 * DefaultStyle.dp Layout.preferredWidth: 346 * DefaultStyle.dp
FormItemLayout { label: qsTr("Confirmation mot de passe")
label: qsTr("Confirmation mot de passe") mandatory: true
mandatory: true enableErrorText: true
enableErrorText: true contentItem: TextField {
contentItem: TextField { id: confirmPwdInput
id: confirmPwdInput hidden: true
hidden: true Layout.preferredWidth: 346 * DefaultStyle.dp
Layout.preferredWidth: 346 * DefaultStyle.dp backgroundBorderColor: passwordItem.errorMessage.length > 0 ? DefaultStyle.danger_500main : DefaultStyle.grey_200
backgroundBorderColor: passwordItem.errorMessage.length > 0 ? DefaultStyle.danger_500main : DefaultStyle.grey_200
}
} }
} }
} }
@ -216,80 +214,80 @@ LoginLayout {
// } // }
// } // }
RowLayout {
spacing: 10 * DefaultStyle.dp
CheckBox {
id: termsCheckBox
}
RowLayout { RowLayout {
spacing: 10 * DefaultStyle.dp spacing: 0
CheckBox { Layout.fillWidth: true
id: termsCheckBox Text {
text: qsTr("J'accepte les ")
font {
pixelSize: 14 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp
}
MouseArea {
anchors.fill: parent
onClicked: termsCheckBox.toggle()
}
} }
RowLayout { Text {
spacing: 0 activeFocusOnTab: true
Layout.fillWidth: true font {
Text { underline: true
text: qsTr("J'accepte les ") pixelSize: 14 * DefaultStyle.dp
font { weight: 400 * DefaultStyle.dp
pixelSize: 14 * DefaultStyle.dp bold: activeFocus
weight: 400 * DefaultStyle.dp }
} text: qsTr("conditions dutilisation")
MouseArea { Keys.onPressed: (event)=> {
anchors.fill: parent if (event.key == Qt.Key_Space || event.key == Qt.Key_Enter || event.key == Qt.Key_Return) {
onClicked: termsCheckBox.toggle() cguMouseArea.clicked(undefined)
event.accepted = true;
} }
} }
Text { MouseArea {
activeFocusOnTab: true id: cguMouseArea
font { anchors.fill: parent
underline: true hoverEnabled: true
pixelSize: 14 * DefaultStyle.dp cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
weight: 400 * DefaultStyle.dp onClicked: Qt.openUrlExternally(ConstantsCpp.CguUrl)
bold: activeFocus }
} }
text: qsTr("conditions dutilisation") Text {
Keys.onPressed: (event)=> { text: qsTr(" et la ")
if (event.key == Qt.Key_Space || event.key == Qt.Key_Enter || event.key == Qt.Key_Return) { font {
cguMouseArea.clicked(undefined) pixelSize: 14 * DefaultStyle.dp
event.accepted = true; weight: 400 * DefaultStyle.dp
} }
} }
MouseArea { Text {
id: cguMouseArea activeFocusOnTab: true
anchors.fill: parent font {
hoverEnabled: true underline: true
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor pixelSize: 14 * DefaultStyle.dp
onClicked: Qt.openUrlExternally(ConstantsCpp.CguUrl) weight: 400 * DefaultStyle.dp
bold: activeFocus
}
text: qsTr("politique de confidentialité.")
Keys.onPressed: (event)=> {
if (event.key == Qt.Key_Space || event.key == Qt.Key_Enter || event.key == Qt.Key_Return) {
privateMouseArea.clicked(undefined)
event.accepted = true;
} }
} }
Text { MouseArea {
text: qsTr(" et la ") id: privateMouseArea
font { anchors.fill: parent
pixelSize: 14 * DefaultStyle.dp hoverEnabled: true
weight: 400 * DefaultStyle.dp cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
} onClicked: Qt.openUrlExternally(ConstantsCpp.PrivatePolicyUrl)
}
Text {
activeFocusOnTab: true
font {
underline: true
pixelSize: 14 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp
bold: activeFocus
}
text: qsTr("politique de confidentialité.")
Keys.onPressed: (event)=> {
if (event.key == Qt.Key_Space || event.key == Qt.Key_Enter || event.key == Qt.Key_Return) {
privateMouseArea.clicked(undefined)
event.accepted = true;
}
}
MouseArea {
id: privateMouseArea
anchors.fill: parent
hoverEnabled: true
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: Qt.openUrlExternally(ConstantsCpp.PrivatePolicyUrl)
}
} }
} }
} }
}
// } // }
Button { Button {
enabled: termsCheckBox.checked enabled: termsCheckBox.checked

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -19,7 +19,7 @@ AbstractWindow {
signal callCreated() signal callCreated()
property var accountProxy property var accountProxy
// TODO : use this to make the border transparent // TODO : use this to make the border transparent
// flags: Qt.Window | Qt.FramelessWindowHint | Qt.WindowTitleHint // flags: Qt.Window | Qt.FramelessWindowHint | Qt.WindowTitleHint
// menuBar: Rectangle { // menuBar: Rectangle {