fix #LINQT-1450 contact responsivity
fix display name conf info participants
This commit is contained in:
parent
7608fbcfdb
commit
586ad1a69d
4 changed files with 117 additions and 76 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -15,46 +15,79 @@ 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
|
||||||
Control.Control {
|
Layout.fillWidth: true
|
||||||
// Layout.preferredWidth: 734 * DefaultStyle.dp
|
columns: mainItem.useVerticalLayout ? 1 : children.length
|
||||||
Layout.fillWidth: true
|
rows: 1
|
||||||
width: 734 * DefaultStyle.dp
|
onColumnsChanged: console.log("columns changed", columns, rows)
|
||||||
height: 100 * DefaultStyle.dp
|
columnSpacing: 49 * DefaultStyle.dp
|
||||||
rightPadding: 21 * DefaultStyle.dp
|
rowSpacing: 27 * DefaultStyle.dp
|
||||||
background: GradientRectangle {
|
|
||||||
anchors.fill: parent
|
RowLayout {
|
||||||
anchors.leftMargin: avatar.width / 2
|
Layout.preferredWidth: 341 * DefaultStyle.dp
|
||||||
radius: 15 * DefaultStyle.dp
|
Control.Control {
|
||||||
borderGradient: Gradient {
|
// Layout.preferredWidth: 734 * DefaultStyle.dp
|
||||||
orientation: Gradient.Horizontal
|
Layout.fillWidth: true
|
||||||
GradientStop { position: 0.0; color: DefaultStyle.grey_100 }
|
width: 734 * DefaultStyle.dp
|
||||||
GradientStop { position: 1.0; color: DefaultStyle.main2_200 }
|
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 {
|
contentItem: RowLayout {
|
||||||
orientation: Gradient.Horizontal
|
id: bannerLayout
|
||||||
GradientStop { position: 0.0; color: DefaultStyle.grey_0 }
|
spacing: 32 * DefaultStyle.dp
|
||||||
GradientStop { position: 1.0; color: DefaultStyle.grey_100 }
|
Avatar {
|
||||||
}
|
id: avatar
|
||||||
}
|
contact: mainItem.contact
|
||||||
contentItem: RowLayout {
|
Layout.preferredWidth: 100 * DefaultStyle.dp
|
||||||
id: bannerLayout
|
Layout.preferredHeight: 100 * DefaultStyle.dp
|
||||||
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 {
|
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
|
||||||
|
|
|
||||||
|
|
@ -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: [
|
bannerContent: [
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: 0
|
spacing: 0
|
||||||
Text {
|
Text {
|
||||||
text: contactDetail.contactName
|
text: contactDetail.contactName
|
||||||
|
Layout.fillWidth: true
|
||||||
|
maximumLineCount: 1
|
||||||
font {
|
font {
|
||||||
pixelSize: 29 * DefaultStyle.dp
|
pixelSize: 29 * DefaultStyle.dp
|
||||||
weight: 800 * DefaultStyle.dp
|
weight: 800 * DefaultStyle.dp
|
||||||
|
|
@ -393,39 +426,11 @@ AbstractMainPage {
|
||||||
font.pixelSize: 14 * DefaultStyle.dp
|
font.pixelSize: 14 * DefaultStyle.dp
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Item{Layout.fillWidth: true},
|
ActionsButtons {
|
||||||
RowLayout {
|
visible: !contactDetail.useVerticalLayout
|
||||||
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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
secondLineContent: ActionsButtons{}
|
||||||
content: Flickable {
|
content: Flickable {
|
||||||
contentWidth: parent.width
|
contentWidth: parent.width
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue