From d742fa9ea0db7f6df92c4f08a77df1bda48a4de0 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Thu, 28 Aug 2025 17:40:10 +0200 Subject: [PATCH] automatically wrap line in meeting description #LINQT-1889 (+ add scrollbar if description is too long to fit in the window) --- Linphone/view/Control/Input/TextArea.qml | 2 + .../view/Page/Form/Meeting/MeetingForm.qml | 3 + .../view/Page/Main/Meeting/MeetingPage.qml | 98 ++++++++++--------- 3 files changed, 57 insertions(+), 46 deletions(-) diff --git a/Linphone/view/Control/Input/TextArea.qml b/Linphone/view/Control/Input/TextArea.qml index 0767136f3..44521a0c9 100644 --- a/Linphone/view/Control/Input/TextArea.qml +++ b/Linphone/view/Control/Input/TextArea.qml @@ -66,6 +66,8 @@ TextEdit { text: mainItem.richFormatText textFormat: Text.RichText wrapMode: mainItem.wrapMode + width: mainItem.width + elide: Text.ElideRight font: mainItem.font color: mainItem.textAreaColor anchors.fill: parent diff --git a/Linphone/view/Page/Form/Meeting/MeetingForm.qml b/Linphone/view/Page/Form/Meeting/MeetingForm.qml index bd4f19217..8f66b778b 100644 --- a/Linphone/view/Page/Form/Meeting/MeetingForm.qml +++ b/Linphone/view/Page/Form/Meeting/MeetingForm.qml @@ -9,6 +9,7 @@ import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle FocusScope { id: mainItem + height: childrenRect.height property bool isCreation property ConferenceInfoGui conferenceInfoGui signal addParticipantsRequested() @@ -212,6 +213,7 @@ FocusScope { id: descriptionEdit Layout.fillWidth: true Layout.preferredWidth: Math.round(275 * DefaultStyle.dp) + Layout.preferredHeight: contentHeight leftPadding: Math.round(8 * DefaultStyle.dp) rightPadding: Math.round(8 * DefaultStyle.dp) //: "Ajouter une description" @@ -219,6 +221,7 @@ FocusScope { placeholderTextColor: DefaultStyle.main2_600 placeholderWeight: Typography.p2l.weight color: DefaultStyle.main2_600 + wrapMode: TextEdit.Wrap Component.onCompleted: text = conferenceInfoGui.core.description font { pixelSize: Typography.p1.pixelSize diff --git a/Linphone/view/Page/Main/Meeting/MeetingPage.qml b/Linphone/view/Page/Main/Meeting/MeetingPage.qml index 7e8a29cca..09fce2209 100644 --- a/Linphone/view/Page/Main/Meeting/MeetingPage.qml +++ b/Linphone/view/Page/Main/Meeting/MeetingPage.qml @@ -29,7 +29,7 @@ AbstractMainPage { }', mainItem) mainItem.selectedConference.core.resetParticipants(addresses) mainItem.selectedConference.core.subject = subject - var item = leftPanelStackView.push(createConf, {"conferenceInfoGui": mainItem.selectedConference, "isCreation": true}) + var item = leftPanelStackView.push(createConf, {"conferenceInfoGui": mainItem.selectedConference}) item.forceActiveFocus() } @@ -42,11 +42,11 @@ AbstractMainPage { ConferenceInfoGui{ }', mainItem) mainItem.selectedConference = confInfoGui - item = leftPanelStackView.push(createConf, {"conferenceInfoGui": mainItem.selectedConference, "isCreation": isCreation}) + item = leftPanelStackView.push(createConf, {"conferenceInfoGui": mainItem.selectedConference}) item.forceActiveFocus() } else { mainItem.selectedConference = confInfoGui - item = overridenRightPanelStackView.push(editConf, {"conferenceInfoGui": mainItem.selectedConference, "isCreation": isCreation}) + item = overridenRightPanelStackView.push(editConf, {"conferenceInfoGui": mainItem.selectedConference}) item.forceActiveFocus() } } @@ -268,7 +268,6 @@ AbstractMainPage { id: createConfLayout objectName: "createConf" property ConferenceInfoGui conferenceInfoGui - property bool isCreation ColumnLayout { spacing: Math.round(33 * DefaultStyle.dp) anchors.fill: parent @@ -326,53 +325,62 @@ AbstractMainPage { } } } - MeetingForm { - id: meetingSetup - conferenceInfoGui: createConfLayout.conferenceInfoGui - isCreation: createConfLayout.isCreation + Control.ScrollView { Layout.fillHeight: true Layout.fillWidth: true - Layout.rightMargin: Math.round(35 * DefaultStyle.dp) - Connections { - target: meetingSetup.conferenceInfoGui ? meetingSetup.conferenceInfoGui.core : null - function onConferenceSchedulerStateChanged() { - var mainWin = UtilsCpp.getMainWindow() - if (meetingSetup.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.Ready) { - leftPanelStackView.pop() - //: "Nouvelle réunion" - UtilsCpp.showInformationPopup(qsTr("meeting_schedule_title"), - //: "Réunion planifiée avec succès" - qsTr("meeting_info_created_toast"), true) - mainWindow.closeLoadingPopup() - } - else if (meetingSetup.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.AllocationPending - || meetingSetup.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.Updating) { - mainWin.showLoadingPopup(qsTr("meeting_schedule_creation_in_progress"), true, function () { + contentHeight: meetingSetup.height + Control.ScrollBar.vertical: ScrollBar { + visible: parent.contentHeight > parent.height + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.right: parent.right + } + contentChildren: MeetingForm { + id: meetingSetup + conferenceInfoGui: createConfLayout.conferenceInfoGui + isCreation: true + anchors.rightMargin: Math.round(35 * DefaultStyle.dp) + Connections { + target: meetingSetup.conferenceInfoGui ? meetingSetup.conferenceInfoGui.core : null + function onConferenceSchedulerStateChanged() { + var mainWin = UtilsCpp.getMainWindow() + if (meetingSetup.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.Ready) { leftPanelStackView.pop() - }) - } else { - if (meetingSetup.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.Error) { - UtilsCpp.showInformationPopup(qsTr("information_popup_error_title"), - //: "Échec de création de la réunion !" - qsTr("meeting_failed_to_schedule_toast"), false) + //: "Nouvelle réunion" + UtilsCpp.showInformationPopup(qsTr("meeting_schedule_title"), + //: "Réunion planifiée avec succès" + qsTr("meeting_info_created_toast"), true) + mainWindow.closeLoadingPopup() } + else if (meetingSetup.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.AllocationPending + || meetingSetup.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.Updating) { + mainWin.showLoadingPopup(qsTr("meeting_schedule_creation_in_progress"), true, function () { + leftPanelStackView.pop() + }) + } else { + if (meetingSetup.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.Error) { + UtilsCpp.showInformationPopup(qsTr("information_popup_error_title"), + //: "Échec de création de la réunion !" + qsTr("meeting_failed_to_schedule_toast"), false) + } + mainWin.closeLoadingPopup() + } + createConfLayout.enabled = meetingSetup.conferenceInfoGui.core.schedulerState != LinphoneEnums.ConferenceSchedulerState.AllocationPending + } + function onSaveFailed() { + var mainWin = UtilsCpp.getMainWindow() mainWin.closeLoadingPopup() } - createConfLayout.enabled = meetingSetup.conferenceInfoGui.core.schedulerState != LinphoneEnums.ConferenceSchedulerState.AllocationPending } - function onSaveFailed() { - var mainWin = UtilsCpp.getMainWindow() - mainWin.closeLoadingPopup() + onAddParticipantsRequested: { + leftPanelStackView.push(addParticipants, {"conferenceInfoGui": conferenceInfoGui, "container": leftPanelStackView}) } - } - onAddParticipantsRequested: { - leftPanelStackView.push(addParticipants, {"conferenceInfoGui": conferenceInfoGui, "container": leftPanelStackView}) - } - Connections { - target: mainItem - onAddParticipantsValidated: (selectedParticipants) => { - meetingSetup.conferenceInfoGui.core.resetParticipants(selectedParticipants) - leftPanelStackView.pop() + Connections { + target: mainItem + onAddParticipantsValidated: (selectedParticipants) => { + meetingSetup.conferenceInfoGui.core.resetParticipants(selectedParticipants) + leftPanelStackView.pop() + } } } } @@ -385,7 +393,6 @@ AbstractMainPage { FocusScope{ id: editFocusScope objectName: "editConf" - property bool isCreation property ConferenceInfoGui conferenceInfoGui width: overridenRightPanelStackView.width ColumnLayout { @@ -468,8 +475,7 @@ AbstractMainPage { } MeetingForm { id: conferenceEdit - property bool isCreation - isCreation: editFocusScope.isCreation + isCreation: false conferenceInfoGui: editFocusScope.conferenceInfoGui Layout.fillWidth: true Layout.preferredHeight: childrenRect.height