fix #LINQT-1450 contact responsivity

fix display name conf info participants
This commit is contained in:
Gaelle Braud 2024-11-28 15:44:29 +01:00
parent 7608fbcfdb
commit 586ad1a69d
4 changed files with 117 additions and 76 deletions

View file

@ -86,12 +86,7 @@ ConferenceInfoCore::ConferenceInfoCore(std::shared_ptr<linphone::ConferenceInfo>
for (auto item : conferenceInfo->getParticipantInfos()) {
QVariantMap participant;
auto address = item->getAddress();
auto name = Utils::coreStringToAppString(address->getDisplayName());
if (name.isEmpty()) {
name = Utils::coreStringToAppString(address->getUsername());
name.replace(".", " ");
}
participant["displayName"] = name;
participant["displayName"] = ToolModel::getDisplayName(address);
participant["address"] = Utils::coreStringToAppString(address->asStringUriOnly());
participant["role"] = (int)LinphoneEnums::fromLinphone(item->getRole());
mParticipants.append(participant);

View file

@ -15,46 +15,79 @@ ColumnLayout {
property alias button: rightButton
property alias content: detailLayout.data
property alias bannerContent: bannerLayout.data
property alias secondLineContent: verticalLayoutSecondLine.data
property int minimumWidthForSwitchintToRowLayout: 756 * DefaultStyle.dp
property var useVerticalLayout
function setResponsivityFlags() {
var mainWin = UtilsCpp.getMainWindow()
var newValue = width < minimumWidthForSwitchintToRowLayout * DefaultStyle.dp
if (useVerticalLayout != newValue) {
useVerticalLayout = newValue
}
}
onWidthChanged: {
setResponsivityFlags()
}
Component.onCompleted: {
setResponsivityFlags()
}
RowLayout {
spacing: 49 * DefaultStyle.dp
GridLayout {
Layout.leftMargin: 64 * DefaultStyle.dp
Layout.rightMargin: 64 * DefaultStyle.dp
Layout.topMargin: 56 * DefaultStyle.dp
Control.Control {
// Layout.preferredWidth: 734 * DefaultStyle.dp
Layout.fillWidth: true
width: 734 * DefaultStyle.dp
height: 100 * DefaultStyle.dp
rightPadding: 21 * DefaultStyle.dp
background: GradientRectangle {
anchors.fill: parent
anchors.leftMargin: avatar.width / 2
radius: 15 * DefaultStyle.dp
borderGradient: Gradient {
orientation: Gradient.Horizontal
GradientStop { position: 0.0; color: DefaultStyle.grey_100 }
GradientStop { position: 1.0; color: DefaultStyle.main2_200 }
Layout.fillWidth: true
columns: mainItem.useVerticalLayout ? 1 : children.length
rows: 1
onColumnsChanged: console.log("columns changed", columns, rows)
columnSpacing: 49 * DefaultStyle.dp
rowSpacing: 27 * DefaultStyle.dp
RowLayout {
Layout.preferredWidth: 341 * DefaultStyle.dp
Control.Control {
// Layout.preferredWidth: 734 * DefaultStyle.dp
Layout.fillWidth: true
width: 734 * DefaultStyle.dp
height: 100 * DefaultStyle.dp
rightPadding: 21 * DefaultStyle.dp
background: GradientRectangle {
anchors.fill: parent
anchors.leftMargin: avatar.width / 2
radius: 15 * DefaultStyle.dp
borderGradient: Gradient {
orientation: Gradient.Horizontal
GradientStop { position: 0.0; color: DefaultStyle.grey_100 }
GradientStop { position: 1.0; color: DefaultStyle.main2_200 }
}
gradient: Gradient {
orientation: Gradient.Horizontal
GradientStop { position: 0.0; color: DefaultStyle.grey_0 }
GradientStop { position: 1.0; color: DefaultStyle.grey_100 }
}
}
gradient: Gradient {
orientation: Gradient.Horizontal
GradientStop { position: 0.0; color: DefaultStyle.grey_0 }
GradientStop { position: 1.0; color: DefaultStyle.grey_100 }
}
}
contentItem: RowLayout {
id: bannerLayout
spacing: 32 * DefaultStyle.dp
Avatar {
id: avatar
contact: mainItem.contact
Layout.preferredWidth: 100 * DefaultStyle.dp
Layout.preferredHeight: 100 * DefaultStyle.dp
contentItem: RowLayout {
id: bannerLayout
spacing: 32 * DefaultStyle.dp
Avatar {
id: avatar
contact: mainItem.contact
Layout.preferredWidth: 100 * DefaultStyle.dp
Layout.preferredHeight: 100 * DefaultStyle.dp
}
}
}
}
Item {
id: verticalLayoutSecondLine
visible: contactDetail.useVerticalLayout
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: childrenRect.width
Layout.preferredHeight: childrenRect.height
}
Button {
id: rightButton
Layout.alignment: Qt.AlignHCenter
width: childrenRect.width
height: childrenRect.height
}
@ -62,7 +95,7 @@ ColumnLayout {
StackLayout {
id: detailLayout
Layout.alignment: Qt.AlignCenter
Layout.topMargin: 30 * DefaultStyle.dp
Layout.topMargin: mainItem.useVerticalLayout ? 0 : 30 * DefaultStyle.dp
Layout.leftMargin: 64 * DefaultStyle.dp
Layout.rightMargin: 64 * DefaultStyle.dp
Layout.bottomMargin: 53 * DefaultStyle.dp

View file

@ -361,11 +361,44 @@ AbstractMainPage {
}
}
}
component ActionsButtons: RowLayout {
spacing: 58 * DefaultStyle.dp
LabelButton {
button.icon.source: AppIcons.phone
label: qsTr("Appel")
width: 56 * DefaultStyle.dp
height: 56 * DefaultStyle.dp
button.icon.width: 24 * DefaultStyle.dp
button.icon.height: 24 * DefaultStyle.dp
button.onClicked: mainWindow.startCallWithContact(contactDetail.contact, false, mainItem)
}
LabelButton {
button.icon.source: AppIcons.chatTeardropText
visible: !SettingsCpp.disableChatFeature
label: qsTr("Message")
width: 56 * DefaultStyle.dp
height: 56 * DefaultStyle.dp
button.icon.width: 24 * DefaultStyle.dp
button.icon.height: 24 * DefaultStyle.dp
button.onClicked: console.debug("[ContactLayout.qml] TODO : open conversation")
}
LabelButton {
button.icon.source: AppIcons.videoCamera
label: qsTr("Appel vidéo")
width: 56 * DefaultStyle.dp
height: 56 * DefaultStyle.dp
button.icon.width: 24 * DefaultStyle.dp
button.icon.height: 24 * DefaultStyle.dp
button.onClicked: mainWindow.startCallWithContact(contactDetail.contact, true, mainItem)
}
}
bannerContent: [
ColumnLayout {
spacing: 0
Text {
text: contactDetail.contactName
Layout.fillWidth: true
maximumLineCount: 1
font {
pixelSize: 29 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp
@ -393,39 +426,11 @@ AbstractMainPage {
font.pixelSize: 14 * DefaultStyle.dp
}
},
Item{Layout.fillWidth: true},
RowLayout {
spacing: 58 * DefaultStyle.dp
LabelButton {
button.icon.source: AppIcons.phone
label: qsTr("Appel")
width: 56 * DefaultStyle.dp
height: 56 * DefaultStyle.dp
button.icon.width: 24 * DefaultStyle.dp
button.icon.height: 24 * DefaultStyle.dp
button.onClicked: mainWindow.startCallWithContact(contactDetail.contact, false, mainItem)
}
LabelButton {
button.icon.source: AppIcons.chatTeardropText
visible: !SettingsCpp.disableChatFeature
label: qsTr("Message")
width: 56 * DefaultStyle.dp
height: 56 * DefaultStyle.dp
button.icon.width: 24 * DefaultStyle.dp
button.icon.height: 24 * DefaultStyle.dp
button.onClicked: console.debug("[ContactLayout.qml] TODO : open conversation")
}
LabelButton {
button.icon.source: AppIcons.videoCamera
label: qsTr("Appel vidéo")
width: 56 * DefaultStyle.dp
height: 56 * DefaultStyle.dp
button.icon.width: 24 * DefaultStyle.dp
button.icon.height: 24 * DefaultStyle.dp
button.onClicked: mainWindow.startCallWithContact(contactDetail.contact, true, mainItem)
}
ActionsButtons {
visible: !contactDetail.useVerticalLayout
}
]
secondLineContent: ActionsButtons{}
content: Flickable {
contentWidth: parent.width
ColumnLayout {

View file

@ -334,15 +334,19 @@ AbstractMainPage {
property bool isCreation
property ConferenceInfoGui conferenceInfoGui
width: overridenRightPanelStackView.width
height: editLayout.implicitHeight
height: editLayout.height
ColumnLayout {
id: editLayout
anchors.fill: parent
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 58 * DefaultStyle.dp
spacing: 0
Section {
Layout.preferredWidth: 393 * DefaultStyle.dp
content: RowLayout {
spacing: 10 * DefaultStyle.dp
spacing: 8 * DefaultStyle.dp
Layout.preferredWidth: overridenRightPanelStackView.width
Layout.preferredHeight: childrenRect.height
Button {
id: backButton
Layout.preferredWidth: 24 * DefaultStyle.dp
@ -360,11 +364,11 @@ AbstractMainPage {
}
background: Item{}
}
TextField {
TextInput {
id: titleText
Layout.fillWidth: true
color: DefaultStyle.main2_600
clip: true
font {
pixelSize: 20 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp
@ -375,8 +379,9 @@ AbstractMainPage {
KeyNavigation.up: conferenceEdit
onActiveFocusChanged: if(activeFocus==true) selectAll()
onEditingFinished: mainItem.selectedConference.core.subject = text
Component.onCompleted: text = mainItem.selectedConference.core.subject
background: Item{}
Component.onCompleted: {
text = mainItem.selectedConference.core.subject
}
}
Button {
id: saveButton
@ -411,6 +416,7 @@ AbstractMainPage {
isCreation: editFocusScope.isCreation
conferenceInfoGui: editFocusScope.conferenceInfoGui
Layout.fillWidth: true
Layout.fillHeight: true
Connections {
target: conferenceEdit.conferenceInfoGui ? conferenceEdit.conferenceInfoGui.core : null
function onConferenceSchedulerStateChanged() {
@ -455,7 +461,6 @@ AbstractMainPage {
}
}
}
Item { Layout.fillHeight: true}
}
}
}
@ -548,6 +553,7 @@ AbstractMainPage {
spacing: 25 * DefaultStyle.dp
Section {
visible: mainItem.selectedConference
Layout.fillWidth: true
content: RowLayout {
spacing: 8 * DefaultStyle.dp
Image {
@ -556,7 +562,9 @@ AbstractMainPage {
Layout.preferredHeight: 24 * DefaultStyle.dp
}
Text {
Layout.fillWidth: true
text: mainItem.selectedConference ? mainItem.selectedConference.core.subject : ""
maximumLineCount: 1
font {
pixelSize: 20 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp