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()) { for (auto item : conferenceInfo->getParticipantInfos()) {
QVariantMap participant; QVariantMap participant;
auto address = item->getAddress(); auto address = item->getAddress();
auto name = Utils::coreStringToAppString(address->getDisplayName()); participant["displayName"] = ToolModel::getDisplayName(address);
if (name.isEmpty()) {
name = Utils::coreStringToAppString(address->getUsername());
name.replace(".", " ");
}
participant["displayName"] = name;
participant["address"] = Utils::coreStringToAppString(address->asStringUriOnly()); participant["address"] = Utils::coreStringToAppString(address->asStringUriOnly());
participant["role"] = (int)LinphoneEnums::fromLinphone(item->getRole()); participant["role"] = (int)LinphoneEnums::fromLinphone(item->getRole());
mParticipants.append(participant); mParticipants.append(participant);

View file

@ -15,12 +15,36 @@ ColumnLayout {
property alias button: rightButton property alias button: rightButton
property alias content: detailLayout.data property alias content: detailLayout.data
property alias bannerContent: bannerLayout.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 { GridLayout {
spacing: 49 * DefaultStyle.dp
Layout.leftMargin: 64 * DefaultStyle.dp Layout.leftMargin: 64 * DefaultStyle.dp
Layout.rightMargin: 64 * DefaultStyle.dp Layout.rightMargin: 64 * DefaultStyle.dp
Layout.topMargin: 56 * DefaultStyle.dp Layout.topMargin: 56 * DefaultStyle.dp
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 { Control.Control {
// Layout.preferredWidth: 734 * DefaultStyle.dp // Layout.preferredWidth: 734 * DefaultStyle.dp
Layout.fillWidth: true Layout.fillWidth: true
@ -53,8 +77,17 @@ ColumnLayout {
} }
} }
} }
}
Item {
id: verticalLayoutSecondLine
visible: contactDetail.useVerticalLayout
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: childrenRect.width
Layout.preferredHeight: childrenRect.height
}
Button { Button {
id: rightButton id: rightButton
Layout.alignment: Qt.AlignHCenter
width: childrenRect.width width: childrenRect.width
height: childrenRect.height height: childrenRect.height
} }
@ -62,7 +95,7 @@ ColumnLayout {
StackLayout { StackLayout {
id: detailLayout id: detailLayout
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.topMargin: 30 * DefaultStyle.dp Layout.topMargin: mainItem.useVerticalLayout ? 0 : 30 * DefaultStyle.dp
Layout.leftMargin: 64 * DefaultStyle.dp Layout.leftMargin: 64 * DefaultStyle.dp
Layout.rightMargin: 64 * DefaultStyle.dp Layout.rightMargin: 64 * DefaultStyle.dp
Layout.bottomMargin: 53 * DefaultStyle.dp Layout.bottomMargin: 53 * DefaultStyle.dp

View file

@ -361,40 +361,7 @@ AbstractMainPage {
} }
} }
} }
bannerContent: [ component ActionsButtons: RowLayout {
ColumnLayout {
spacing: 0
Text {
text: contactDetail.contactName
font {
pixelSize: 29 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp
}
}
Text {
visible: contactDetail.contact
property var mode : contactDetail.contact ? contactDetail.contact.core.consolidatedPresence : -1
horizontalAlignment: Text.AlignLeft
Layout.fillWidth: true
text: mode === LinphoneEnums.ConsolidatedPresence.Online
? qsTr("En ligne")
: mode === LinphoneEnums.ConsolidatedPresence.Busy
? qsTr("Occupé")
: mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb
? qsTr("Ne pas déranger")
: qsTr("Hors ligne")
color: mode === LinphoneEnums.ConsolidatedPresence.Online
? DefaultStyle.success_500main
: mode === LinphoneEnums.ConsolidatedPresence.Busy
? DefaultStyle.warning_600
: mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb
? DefaultStyle.danger_500main
: DefaultStyle.main2_500main
font.pixelSize: 14 * DefaultStyle.dp
}
},
Item{Layout.fillWidth: true},
RowLayout {
spacing: 58 * DefaultStyle.dp spacing: 58 * DefaultStyle.dp
LabelButton { LabelButton {
button.icon.source: AppIcons.phone button.icon.source: AppIcons.phone
@ -425,7 +392,45 @@ AbstractMainPage {
button.onClicked: mainWindow.startCallWithContact(contactDetail.contact, true, mainItem) 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
}
}
Text {
visible: contactDetail.contact
property var mode : contactDetail.contact ? contactDetail.contact.core.consolidatedPresence : -1
horizontalAlignment: Text.AlignLeft
Layout.fillWidth: true
text: mode === LinphoneEnums.ConsolidatedPresence.Online
? qsTr("En ligne")
: mode === LinphoneEnums.ConsolidatedPresence.Busy
? qsTr("Occupé")
: mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb
? qsTr("Ne pas déranger")
: qsTr("Hors ligne")
color: mode === LinphoneEnums.ConsolidatedPresence.Online
? DefaultStyle.success_500main
: mode === LinphoneEnums.ConsolidatedPresence.Busy
? DefaultStyle.warning_600
: mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb
? DefaultStyle.danger_500main
: DefaultStyle.main2_500main
font.pixelSize: 14 * DefaultStyle.dp
}
},
ActionsButtons {
visible: !contactDetail.useVerticalLayout
}
] ]
secondLineContent: ActionsButtons{}
content: Flickable { content: Flickable {
contentWidth: parent.width contentWidth: parent.width
ColumnLayout { ColumnLayout {

View file

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