automatically wrap line in meeting description #LINQT-1889 (+ add scrollbar if description is too long to fit in the window)

This commit is contained in:
Gaelle Braud 2025-08-28 17:40:10 +02:00
parent 4b613f1787
commit d742fa9ea0
3 changed files with 57 additions and 46 deletions

View file

@ -66,6 +66,8 @@ TextEdit {
text: mainItem.richFormatText text: mainItem.richFormatText
textFormat: Text.RichText textFormat: Text.RichText
wrapMode: mainItem.wrapMode wrapMode: mainItem.wrapMode
width: mainItem.width
elide: Text.ElideRight
font: mainItem.font font: mainItem.font
color: mainItem.textAreaColor color: mainItem.textAreaColor
anchors.fill: parent anchors.fill: parent

View file

@ -9,6 +9,7 @@ import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
FocusScope { FocusScope {
id: mainItem id: mainItem
height: childrenRect.height
property bool isCreation property bool isCreation
property ConferenceInfoGui conferenceInfoGui property ConferenceInfoGui conferenceInfoGui
signal addParticipantsRequested() signal addParticipantsRequested()
@ -212,6 +213,7 @@ FocusScope {
id: descriptionEdit id: descriptionEdit
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredWidth: Math.round(275 * DefaultStyle.dp) Layout.preferredWidth: Math.round(275 * DefaultStyle.dp)
Layout.preferredHeight: contentHeight
leftPadding: Math.round(8 * DefaultStyle.dp) leftPadding: Math.round(8 * DefaultStyle.dp)
rightPadding: Math.round(8 * DefaultStyle.dp) rightPadding: Math.round(8 * DefaultStyle.dp)
//: "Ajouter une description" //: "Ajouter une description"
@ -219,6 +221,7 @@ FocusScope {
placeholderTextColor: DefaultStyle.main2_600 placeholderTextColor: DefaultStyle.main2_600
placeholderWeight: Typography.p2l.weight placeholderWeight: Typography.p2l.weight
color: DefaultStyle.main2_600 color: DefaultStyle.main2_600
wrapMode: TextEdit.Wrap
Component.onCompleted: text = conferenceInfoGui.core.description Component.onCompleted: text = conferenceInfoGui.core.description
font { font {
pixelSize: Typography.p1.pixelSize pixelSize: Typography.p1.pixelSize

View file

@ -29,7 +29,7 @@ AbstractMainPage {
}', mainItem) }', mainItem)
mainItem.selectedConference.core.resetParticipants(addresses) mainItem.selectedConference.core.resetParticipants(addresses)
mainItem.selectedConference.core.subject = subject 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() item.forceActiveFocus()
} }
@ -42,11 +42,11 @@ AbstractMainPage {
ConferenceInfoGui{ ConferenceInfoGui{
}', mainItem) }', mainItem)
mainItem.selectedConference = confInfoGui mainItem.selectedConference = confInfoGui
item = leftPanelStackView.push(createConf, {"conferenceInfoGui": mainItem.selectedConference, "isCreation": isCreation}) item = leftPanelStackView.push(createConf, {"conferenceInfoGui": mainItem.selectedConference})
item.forceActiveFocus() item.forceActiveFocus()
} else { } else {
mainItem.selectedConference = confInfoGui mainItem.selectedConference = confInfoGui
item = overridenRightPanelStackView.push(editConf, {"conferenceInfoGui": mainItem.selectedConference, "isCreation": isCreation}) item = overridenRightPanelStackView.push(editConf, {"conferenceInfoGui": mainItem.selectedConference})
item.forceActiveFocus() item.forceActiveFocus()
} }
} }
@ -268,7 +268,6 @@ AbstractMainPage {
id: createConfLayout id: createConfLayout
objectName: "createConf" objectName: "createConf"
property ConferenceInfoGui conferenceInfoGui property ConferenceInfoGui conferenceInfoGui
property bool isCreation
ColumnLayout { ColumnLayout {
spacing: Math.round(33 * DefaultStyle.dp) spacing: Math.round(33 * DefaultStyle.dp)
anchors.fill: parent anchors.fill: parent
@ -326,53 +325,62 @@ AbstractMainPage {
} }
} }
} }
MeetingForm { Control.ScrollView {
id: meetingSetup
conferenceInfoGui: createConfLayout.conferenceInfoGui
isCreation: createConfLayout.isCreation
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
Layout.rightMargin: Math.round(35 * DefaultStyle.dp) contentHeight: meetingSetup.height
Connections { Control.ScrollBar.vertical: ScrollBar {
target: meetingSetup.conferenceInfoGui ? meetingSetup.conferenceInfoGui.core : null visible: parent.contentHeight > parent.height
function onConferenceSchedulerStateChanged() { anchors.top: parent.top
var mainWin = UtilsCpp.getMainWindow() anchors.bottom: parent.bottom
if (meetingSetup.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.Ready) { anchors.right: parent.right
leftPanelStackView.pop() }
//: "Nouvelle réunion" contentChildren: MeetingForm {
UtilsCpp.showInformationPopup(qsTr("meeting_schedule_title"), id: meetingSetup
//: "Réunion planifiée avec succès" conferenceInfoGui: createConfLayout.conferenceInfoGui
qsTr("meeting_info_created_toast"), true) isCreation: true
mainWindow.closeLoadingPopup() anchors.rightMargin: Math.round(35 * DefaultStyle.dp)
} Connections {
else if (meetingSetup.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.AllocationPending target: meetingSetup.conferenceInfoGui ? meetingSetup.conferenceInfoGui.core : null
|| meetingSetup.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.Updating) { function onConferenceSchedulerStateChanged() {
mainWin.showLoadingPopup(qsTr("meeting_schedule_creation_in_progress"), true, function () { var mainWin = UtilsCpp.getMainWindow()
if (meetingSetup.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.Ready) {
leftPanelStackView.pop() leftPanelStackView.pop()
}) //: "Nouvelle réunion"
} else { UtilsCpp.showInformationPopup(qsTr("meeting_schedule_title"),
if (meetingSetup.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.Error) { //: "Réunion planifiée avec succès"
UtilsCpp.showInformationPopup(qsTr("information_popup_error_title"), qsTr("meeting_info_created_toast"), true)
//: "Échec de création de la réunion !" mainWindow.closeLoadingPopup()
qsTr("meeting_failed_to_schedule_toast"), false)
} }
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() mainWin.closeLoadingPopup()
} }
createConfLayout.enabled = meetingSetup.conferenceInfoGui.core.schedulerState != LinphoneEnums.ConferenceSchedulerState.AllocationPending
} }
function onSaveFailed() { onAddParticipantsRequested: {
var mainWin = UtilsCpp.getMainWindow() leftPanelStackView.push(addParticipants, {"conferenceInfoGui": conferenceInfoGui, "container": leftPanelStackView})
mainWin.closeLoadingPopup()
} }
} Connections {
onAddParticipantsRequested: { target: mainItem
leftPanelStackView.push(addParticipants, {"conferenceInfoGui": conferenceInfoGui, "container": leftPanelStackView}) onAddParticipantsValidated: (selectedParticipants) => {
} meetingSetup.conferenceInfoGui.core.resetParticipants(selectedParticipants)
Connections { leftPanelStackView.pop()
target: mainItem }
onAddParticipantsValidated: (selectedParticipants) => {
meetingSetup.conferenceInfoGui.core.resetParticipants(selectedParticipants)
leftPanelStackView.pop()
} }
} }
} }
@ -385,7 +393,6 @@ AbstractMainPage {
FocusScope{ FocusScope{
id: editFocusScope id: editFocusScope
objectName: "editConf" objectName: "editConf"
property bool isCreation
property ConferenceInfoGui conferenceInfoGui property ConferenceInfoGui conferenceInfoGui
width: overridenRightPanelStackView.width width: overridenRightPanelStackView.width
ColumnLayout { ColumnLayout {
@ -468,8 +475,7 @@ AbstractMainPage {
} }
MeetingForm { MeetingForm {
id: conferenceEdit id: conferenceEdit
property bool isCreation isCreation: false
isCreation: editFocusScope.isCreation
conferenceInfoGui: editFocusScope.conferenceInfoGui conferenceInfoGui: editFocusScope.conferenceInfoGui
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: childrenRect.height Layout.preferredHeight: childrenRect.height