fix meeting list height + position view at current date

This commit is contained in:
Gaelle Braud 2024-03-14 15:37:47 +01:00 committed by Julien Wadel
parent 1e34f38782
commit 6cfb26ba1b
2 changed files with 34 additions and 52 deletions

View file

@ -8,7 +8,6 @@ import UtilsCpp 1.0
ListView {
id: mainItem
height: contentHeight
visible: count > 0
clip: true
@ -80,6 +79,7 @@ ListView {
radius: 50 * DefaultStyle.dp
property var isCurrentDay: UtilsCpp.isCurrentDay(dateTime)
color: isCurrentDay ? DefaultStyle.main1_500_main : "transparent"
Component.onCompleted: if(isCurrentDay) mainItem.currentIndex = index
Text {
anchors.centerIn: parent
text: UtilsCpp.toDateDayString(dateTime)
@ -95,7 +95,7 @@ ListView {
id: conferenceInfoDelegate
anchors.left: dateDay.visible ? dateDay.right : parent.left
anchors.leftMargin: 10 * DefaultStyle.dp + mainItem.delegateLeftMargin
anchors.rightMargin: 10 * DefaultStyle.dp + mainItem.delegateLeftMargin
anchors.rightMargin: 25 * DefaultStyle.dp + mainItem.delegateLeftMargin
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
radius: 10 * DefaultStyle.dp

View file

@ -49,21 +49,10 @@ AbstractMainPage {
ColumnLayout {
Layout.topMargin: 30 * DefaultStyle.dp
Layout.leftMargin: leftPanel.sideMargin
Layout.rightMargin: leftPanel.sideMargin
enabled: mainItem.leftPanelEnabled
Item {
Layout.fillWidth: true
Layout.fillHeight: true
Control.ScrollBar {
id: meetingsScrollbar
active: true
interactive: true
policy: Control.ScrollBar.AsNeeded
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
}
Control.StackView {
id: leftPanelStackView
initialItem: listLayout
@ -106,47 +95,40 @@ AbstractMainPage {
Layout.fillWidth: true
placeholderText: qsTr("Rechercher une réunion")
}
Control.ScrollView {
Text {
Layout.fillHeight: true
Layout.alignment: Qt.AlignHCenter
text: mainItem.emptyListText
font {
pixelSize: 16 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp
}
visible: mainItem.showDefaultItem
}
MeetingList {
id: conferenceList
visible: count != 0
hoverEnabled: mainItem.leftPanelEnabled
Layout.fillWidth: true
Layout.fillHeight: true
rightPadding: leftPanel.sideMargin
contentWidth: width - leftPanel.sideMargin
contentHeight: content.height
clip: true
Control.ScrollBar.vertical: meetingsScrollbar
ColumnLayout {
id: content
width: parent.width
anchors.topMargin: 5 * DefaultStyle.dp
anchors.fill: parent
spacing: 15 * DefaultStyle.dp
Text {
Layout.fillHeight: true
Layout.alignment: Qt.AlignHCenter
text: mainItem.emptyListText
font {
pixelSize: 16 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp
}
visible: mainItem.showDefaultItem
}
MeetingList {
id: conferenceList
visible: count != 0
hoverEnabled: mainItem.leftPanelEnabled
Layout.preferredWidth: parent.width
Layout.fillWidth: true
Layout.fillHeight: true
Layout.topMargin: 20 * DefaultStyle.dp
searchBarText: searchBar.text
onSelectedConferenceChanged: {
mainItem.selectedConference = selectedConference
}
onCountChanged: {
mainItem.meetingListCount = count
}
}
Layout.topMargin: 20 * DefaultStyle.dp
searchBarText: searchBar.text
onSelectedConferenceChanged: {
mainItem.selectedConference = selectedConference
}
onCountChanged: {
mainItem.meetingListCount = count
}
Control.ScrollBar.vertical: Control.ScrollBar {
id: meetingsScrollbar
active: true
interactive: true
policy: Control.ScrollBar.AsNeeded
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
}
}
}