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,13 +325,21 @@ 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
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 { Connections {
target: meetingSetup.conferenceInfoGui ? meetingSetup.conferenceInfoGui.core : null target: meetingSetup.conferenceInfoGui ? meetingSetup.conferenceInfoGui.core : null
function onConferenceSchedulerStateChanged() { function onConferenceSchedulerStateChanged() {
@ -379,13 +386,13 @@ AbstractMainPage {
} }
} }
} }
}
Component { Component {
id: editConf id: editConf
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