From 23a4374364c5b1ed9e52d9ad72fcd27120ba3f3e Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 18 Aug 2022 17:58:18 +0200 Subject: [PATCH] Change mapping design of conference info into list. Change meetings list design in order to simplify size managment : meetings are now displayed in one column like a chat. Fix binding loops in chat calendar. --- linphone-app/CMakeLists.txt | 6 +- ...pModel.cpp => ConferenceInfoListModel.cpp} | 49 +++++++------ ...pModel.hpp => ConferenceInfoListModel.hpp} | 18 +++-- .../ConferenceInfoProxyListModel.cpp | 70 ------------------- .../ConferenceInfoProxyListModel.hpp | 50 ------------- .../ConferenceInfoProxyModel.cpp | 45 +++++++----- .../ConferenceInfoProxyModel.hpp | 5 +- .../Linphone/Chat/ChatCalendarMessage.qml | 47 ++++++++----- .../ui/views/App/Main/Conferences.qml | 65 ++++++++--------- 9 files changed, 125 insertions(+), 230 deletions(-) rename linphone-app/src/components/conferenceInfo/{ConferenceInfoMapModel.cpp => ConferenceInfoListModel.cpp} (61%) rename linphone-app/src/components/conferenceInfo/{ConferenceInfoMapModel.hpp => ConferenceInfoListModel.hpp} (70%) delete mode 100644 linphone-app/src/components/conferenceInfo/ConferenceInfoProxyListModel.cpp delete mode 100644 linphone-app/src/components/conferenceInfo/ConferenceInfoProxyListModel.hpp diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt index 172fd81a5..ec594890e 100644 --- a/linphone-app/CMakeLists.txt +++ b/linphone-app/CMakeLists.txt @@ -187,8 +187,7 @@ set(SOURCES src/components/conference/ConferenceModel.cpp src/components/conference/ConferenceProxyModel.cpp src/components/conferenceInfo/ConferenceInfoModel.cpp - src/components/conferenceInfo/ConferenceInfoMapModel.cpp - src/components/conferenceInfo/ConferenceInfoProxyListModel.cpp + src/components/conferenceInfo/ConferenceInfoListModel.cpp src/components/conferenceInfo/ConferenceInfoProxyModel.cpp src/components/conferenceScheduler/ConferenceScheduler.cpp src/components/conferenceScheduler/ConferenceSchedulerListener.cpp @@ -321,8 +320,7 @@ set(HEADERS src/components/conference/ConferenceModel.hpp src/components/conference/ConferenceProxyModel.hpp src/components/conferenceInfo/ConferenceInfoModel.hpp - src/components/conferenceInfo/ConferenceInfoMapModel.hpp - src/components/conferenceInfo/ConferenceInfoProxyListModel.hpp + src/components/conferenceInfo/ConferenceInfoListModel.hpp src/components/conferenceInfo/ConferenceInfoProxyModel.hpp src/components/conferenceScheduler/ConferenceScheduler.hpp src/components/conferenceScheduler/ConferenceSchedulerListener.hpp diff --git a/linphone-app/src/components/conferenceInfo/ConferenceInfoMapModel.cpp b/linphone-app/src/components/conferenceInfo/ConferenceInfoListModel.cpp similarity index 61% rename from linphone-app/src/components/conferenceInfo/ConferenceInfoMapModel.cpp rename to linphone-app/src/components/conferenceInfo/ConferenceInfoListModel.cpp index c959c2fc0..24d3ae01c 100644 --- a/linphone-app/src/components/conferenceInfo/ConferenceInfoMapModel.cpp +++ b/linphone-app/src/components/conferenceInfo/ConferenceInfoListModel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Belledonne Communications SARL. + * Copyright (c) 2022 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -#include "ConferenceInfoMapModel.hpp" +#include "ConferenceInfoListModel.hpp" #include #include @@ -34,11 +34,10 @@ #include "ConferenceInfoProxyModel.hpp" #include "ConferenceInfoModel.hpp" -#include "ConferenceInfoProxyListModel.hpp" // ============================================================================= -ConferenceInfoMapModel::ConferenceInfoMapModel (QObject *parent) : ProxyAbstractMapModel*>(parent) { +ConferenceInfoListModel::ConferenceInfoListModel (QObject *parent) : ProxyListModel(parent) { auto conferenceInfos = CoreManager::getInstance()->getCore()->getConferenceInformationList(); for(auto conferenceInfo : conferenceInfos){ add(conferenceInfo, false); @@ -47,7 +46,7 @@ ConferenceInfoMapModel::ConferenceInfoMapModel (QObject *parent) : ProxyAbstract // ----------------------------------------------------------------------------- -void ConferenceInfoMapModel::add(const std::shared_ptr & conferenceInfo, const bool& sendEvents){ +void ConferenceInfoListModel::add(const std::shared_ptr & conferenceInfo, const bool& sendEvents){ auto me = CoreManager::getInstance()->getCore()->getDefaultAccount()->getParams()->getIdentityAddress(); std::list> participants = conferenceInfo->getParticipants(); bool haveMe = conferenceInfo->getOrganizer()->weakEqual(me); @@ -57,24 +56,24 @@ void ConferenceInfoMapModel::add(const std::shared_ptr }) != participants.end()); if(haveMe){ auto conferenceInfoModel = ConferenceInfoModel::create( conferenceInfo ); - QDate conferenceDateTimeSystem = conferenceInfoModel->getDateTimeSystem().date(); - if( !mMappedList.contains(conferenceDateTimeSystem)){ - auto proxy = new ConferenceInfoProxyListModel(this); - connect(this, &ConferenceInfoMapModel::filterTypeChanged, proxy, &ConferenceInfoProxyListModel::setFilterType); - if(sendEvents){ - int row = 0; - auto it = mMappedList.begin(); - while(it != mMappedList.end() && it.key() < conferenceDateTimeSystem){ - ++row; - ++it; - } - beginInsertColumns(QModelIndex(), row, row); - } - mMappedList[conferenceDateTimeSystem] = proxy; - if(sendEvents) - endInsertColumns(); - } - mMappedList[conferenceDateTimeSystem]->add(conferenceInfoModel); - connect(conferenceInfoModel.get(), &ConferenceInfoModel::removed, qobject_cast(mMappedList[conferenceDateTimeSystem]), &ConferenceInfoProxyListModel::onRemoved); + ProxyListModel::add(conferenceInfoModel); } -} \ No newline at end of file +} + +QHash ConferenceInfoListModel::roleNames () const{ + QHash roles; + roles[Qt::DisplayRole] = "$modelData"; + roles[Qt::DisplayRole+1] = "$sectionDate"; + return roles; +} + +QVariant ConferenceInfoListModel::data (const QModelIndex &index, int role ) const{ + int row = index.row(); + if (!index.isValid() || row < 0 || row >= mList.count()) + return QVariant(); + if (role == Qt::DisplayRole) + return QVariant::fromValue(mList[row].get()); + else if (role == Qt::DisplayRole +1 ) + return QVariant::fromValue(mList[row].objectCast()->getDateTimeUtc().date()); + return QVariant(); + } \ No newline at end of file diff --git a/linphone-app/src/components/conferenceInfo/ConferenceInfoMapModel.hpp b/linphone-app/src/components/conferenceInfo/ConferenceInfoListModel.hpp similarity index 70% rename from linphone-app/src/components/conferenceInfo/ConferenceInfoMapModel.hpp rename to linphone-app/src/components/conferenceInfo/ConferenceInfoListModel.hpp index fef9be678..3cf822144 100644 --- a/linphone-app/src/components/conferenceInfo/ConferenceInfoMapModel.hpp +++ b/linphone-app/src/components/conferenceInfo/ConferenceInfoListModel.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Belledonne Communications SARL. + * Copyright (c) 2022 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). @@ -18,27 +18,31 @@ * along with this program. If not, see . */ -#ifndef _CONFERENCE_INFO_MAP_MODEL_H_ -#define _CONFERENCE_INFO_MAP_MODEL_H_ +#ifndef _CONFERENCE_INFO_LIST_MODEL_H_ +#define _CONFERENCE_INFO_LIST_MODEL_H_ #include #include -#include "app/proxyModel/ProxyAbstractMapModel.hpp" +#include "app/proxyModel/ProxyAbstractListModel.hpp" #include "app/proxyModel/ProxyListModel.hpp" #include "app/proxyModel/SortFilterAbstractProxyModel.hpp" // ============================================================================= -class ConferenceInfoMapModel : public ProxyAbstractMapModel*> { +class ConferenceInfoListModel : public ProxyListModel { Q_OBJECT public: - ConferenceInfoMapModel (QObject *parent = Q_NULLPTR); + ConferenceInfoListModel (QObject *parent = Q_NULLPTR); void add(const std::shared_ptr & conferenceInfo, const bool& sendEvents = true); + + QHash roleNames () const override; + virtual QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const override; + signals: void filterTypeChanged(int filterType); }; -Q_DECLARE_METATYPE(ConferenceInfoMapModel*) +Q_DECLARE_METATYPE(ConferenceInfoListModel*) #endif diff --git a/linphone-app/src/components/conferenceInfo/ConferenceInfoProxyListModel.cpp b/linphone-app/src/components/conferenceInfo/ConferenceInfoProxyListModel.cpp deleted file mode 100644 index 29600ca95..000000000 --- a/linphone-app/src/components/conferenceInfo/ConferenceInfoProxyListModel.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2022 Belledonne Communications SARL. - * - * This file is part of linphone-desktop - * (see https://www.linphone.org). - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "app/proxyModel/ProxyListModel.hpp" -#include "ConferenceInfoProxyListModel.hpp" - -#include "components/call/CallModel.hpp" -#include "components/core/CoreManager.hpp" - -#include "ConferenceInfoMapModel.hpp" - -#include "utils/Utils.hpp" - - -// ============================================================================= - -using namespace std; - -//--------------------------------------------------------------------------------------------- - -ConferenceInfoProxyListModel::ConferenceInfoProxyListModel (QObject *parent) : SortFilterAbstractProxyModel(new ProxyListModel(parent), parent) { -} - -bool ConferenceInfoProxyListModel::filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const { - auto listModel = qobject_cast(sourceModel()); - if(listModel){ - QModelIndex index = listModel->index(sourceRow, 0, QModelIndex()); - const ConferenceInfoModel* ics = sourceModel()->data(index).value(); - if(ics){ - QDateTime currentDateTime = QDateTime::currentDateTime(); - if( mFilterType == 0){ - return ics->getEndDateTime() < currentDateTime; - }else if( mFilterType == 1){ - return ics->getEndDateTime() >= currentDateTime; - }else if( mFilterType == 2){ - return !Utils::isMe(ics->getOrganizer()); - }else - return mFilterType == -1; - } - } - return true; -} - -bool ConferenceInfoProxyListModel::lessThan (const QModelIndex &left, const QModelIndex &right) const { - const ConferenceInfoModel* a = sourceModel()->data(left).value(); - const ConferenceInfoModel* b = sourceModel()->data(right).value(); - return a->getDateTimeUtc() < b->getDateTimeUtc(); -} - -void ConferenceInfoProxyListModel::onRemoved(){ - auto model = qobject_cast(sender()); - remove(model); -} \ No newline at end of file diff --git a/linphone-app/src/components/conferenceInfo/ConferenceInfoProxyListModel.hpp b/linphone-app/src/components/conferenceInfo/ConferenceInfoProxyListModel.hpp deleted file mode 100644 index 748b123c6..000000000 --- a/linphone-app/src/components/conferenceInfo/ConferenceInfoProxyListModel.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2010-2020 Belledonne Communications SARL. - * - * This file is part of linphone-desktop - * (see https://www.linphone.org). - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef CONFERENCE_INFO_PROXY_LIST_MODEL_H_ -#define CONFERENCE_INFO_PROXY_LIST_MODEL_H_ - -#include -#include - -#include "ConferenceInfoModel.hpp" -#include "app/proxyModel/SortFilterAbstractProxyModel.hpp" - - -// ============================================================================= - -class QWindow; -class ProxyListModel; - - -class ConferenceInfoProxyListModel : public SortFilterAbstractProxyModel { - Q_OBJECT - -public: - ConferenceInfoProxyListModel (QObject *parent = Q_NULLPTR); - - void onRemoved(); - -protected: - bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override; - bool lessThan (const QModelIndex &left, const QModelIndex &right) const override; -}; - -#endif diff --git a/linphone-app/src/components/conferenceInfo/ConferenceInfoProxyModel.cpp b/linphone-app/src/components/conferenceInfo/ConferenceInfoProxyModel.cpp index 15a8c03b1..c0ab02c9c 100644 --- a/linphone-app/src/components/conferenceInfo/ConferenceInfoProxyModel.cpp +++ b/linphone-app/src/components/conferenceInfo/ConferenceInfoProxyModel.cpp @@ -25,49 +25,60 @@ #include "components/core/CoreHandlers.hpp" #include "components/settings/AccountSettingsModel.hpp" -#include "ConferenceInfoMapModel.hpp" -#include "ConferenceInfoProxyListModel.hpp" +#include "ConferenceInfoListModel.hpp" +#include "utils/Utils.hpp" // ============================================================================= using namespace std; //--------------------------------------------------------------------------------------------- -ConferenceInfoProxyModel::ConferenceInfoProxyModel (QObject *parent) : SortFilterAbstractProxyModel(new ConferenceInfoMapModel(parent), parent) { +ConferenceInfoProxyModel::ConferenceInfoProxyModel (QObject *parent) : SortFilterAbstractProxyModel(new ConferenceInfoListModel(parent), parent) { connect(CoreManager::getInstance()->getAccountSettingsModel(), &AccountSettingsModel::primarySipAddressChanged, this, &ConferenceInfoProxyModel::update); - connect(this, &ConferenceInfoProxyModel::filterTypeChanged, qobject_cast(sourceModel()), &ConferenceInfoMapModel::filterTypeChanged); + //connect(this, &ConferenceInfoProxyModel::filterTypeChanged, qobject_cast(sourceModel()), &ConferenceInfoListModel); connect(CoreManager::getInstance()->getHandlers().get(), &CoreHandlers::conferenceInfoReceived, this, &ConferenceInfoProxyModel::onConferenceInfoReceived); setFilterType((int)Scheduled); } void ConferenceInfoProxyModel::update(){ int oldFilter = getFilterType(); - SortFilterAbstractProxyModel::update(new ConferenceInfoMapModel(parent())); + SortFilterAbstractProxyModel::update(new ConferenceInfoListModel(parent())); setFilterType(oldFilter+1); - connect(this, &ConferenceInfoProxyModel::filterTypeChanged, qobject_cast(sourceModel()), &ConferenceInfoMapModel::filterTypeChanged); + //connect(this, &ConferenceInfoProxyModel::filterTypeChanged, qobject_cast(sourceModel()), &ConferenceInfoListModel::filterTypeChanged); setFilterType(oldFilter); } bool ConferenceInfoProxyModel::filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const { - QModelIndex index = sourceModel()->index(sourceRow, 0, QModelIndex()); - const ConferenceInfoMapModel* ics = sourceModel()->data(index).value(); - if(ics){ - int r = ics->rowCount(); - return r > 0; - } - const ConferenceInfoProxyListModel* listModel = sourceModel()->data(index).value(); + auto listModel = qobject_cast(sourceModel()); if(listModel){ - int r = listModel->rowCount(); - return r > 0; + QModelIndex index = listModel->index(sourceRow, 0, QModelIndex()); + const ConferenceInfoModel* ics = sourceModel()->data(index).value(); + if(ics){ + QDateTime currentDateTime = QDateTime::currentDateTime(); + if( mFilterType == 0){ + return ics->getEndDateTime() < currentDateTime; + }else if( mFilterType == 1){ + return ics->getEndDateTime() >= currentDateTime; + }else if( mFilterType == 2){ + return !Utils::isMe(ics->getOrganizer()); + }else + return mFilterType == -1; + } } - return false; + return true; +} + +bool ConferenceInfoProxyModel::lessThan (const QModelIndex &left, const QModelIndex &right) const { + const ConferenceInfoModel* a = sourceModel()->data(left).value(); + const ConferenceInfoModel* b = sourceModel()->data(right).value(); + return a->getDateTimeUtc() < b->getDateTimeUtc(); } void ConferenceInfoProxyModel::onConferenceInfoReceived(const std::shared_ptr & conferenceInfo){ auto realConferenceInfo = ConferenceInfoModel::findConferenceInfo(conferenceInfo); if( realConferenceInfo ){ - auto model = qobject_cast(sourceModel()); + auto model = qobject_cast(sourceModel()); model->add(realConferenceInfo); }else qWarning() << "No conferenceInfo have beend found for " << conferenceInfo->getUri()->asString().c_str(); diff --git a/linphone-app/src/components/conferenceInfo/ConferenceInfoProxyModel.hpp b/linphone-app/src/components/conferenceInfo/ConferenceInfoProxyModel.hpp index b215b7eaf..819d02c19 100644 --- a/linphone-app/src/components/conferenceInfo/ConferenceInfoProxyModel.hpp +++ b/linphone-app/src/components/conferenceInfo/ConferenceInfoProxyModel.hpp @@ -31,10 +31,10 @@ // ============================================================================= class QWindow; -class ConferenceInfoMapModel; +class ConferenceInfoListModel; -class ConferenceInfoProxyModel : public SortFilterAbstractProxyModel { +class ConferenceInfoProxyModel : public SortFilterAbstractProxyModel { class ChatRoomModelFilter; Q_OBJECT @@ -54,6 +54,7 @@ public: protected: bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override; + bool lessThan (const QModelIndex &left, const QModelIndex &right) const override; private: diff --git a/linphone-app/ui/modules/Linphone/Chat/ChatCalendarMessage.qml b/linphone-app/ui/modules/Linphone/Chat/ChatCalendarMessage.qml index 901335c96..ceb2b79b4 100644 --- a/linphone-app/ui/modules/Linphone/Chat/ChatCalendarMessage.qml +++ b/linphone-app/ui/modules/Linphone/Chat/ChatCalendarMessage.qml @@ -26,7 +26,7 @@ Loader{ property ContentModel contentModel property ConferenceInfoModel conferenceInfoModel: contentModel ? contentModel.conferenceInfoModel : null property int maxWidth : parent.width - property int fitHeight: active && item ? item.fitHeight + (isExpanded? 200 : 0): 0 + property int fitHeight: active && item ? item.fitHeight : 0 property int fitWidth: active && item ? maxWidth/2 + ChatCalendarMessageStyle.widthMargin*2 : 0 property bool containsMouse: false property int gotoButtonMode: -1 //-1: hide, 0:goto, 1:MoreInfo @@ -60,7 +60,15 @@ Loader{ ColumnLayout{ id: layout - property int fitHeight: dateRow.implicitHeight + title.implicitHeight + participantsRow.implicitHeight +expandedDescription.implicitHeight + // Fix for binding loops + property int participantsFitHeight: 0 + property int expandedFitHeight: 0 + function updateFitHeight(){ + participantsFitHeight = participantsRow.implicitHeight + expandedFitHeight = (expandedDescription.visible? expandedDescription.implicitHeight : 0) + } + + property int fitHeight: dateRow.implicitHeight + title.implicitHeight + participantsFitHeight + expandedFitHeight property int fitWidth: Layout.minimumWidth anchors.fill: parent spacing: 0 @@ -141,9 +149,12 @@ Loader{ Layout.rightMargin: 10 spacing: ChatCalendarMessageStyle.participants.spacing + property int participantLineHeight: participantsList.implicitHeight + // Fix for binding loops + onImplicitHeightChanged: Qt.callLater( layout.updateFitHeight) Item{ - Layout.preferredHeight: ChatCalendarMessageStyle.lineHeight + Layout.preferredHeight: parent.participantLineHeight Layout.preferredWidth: ChatCalendarMessageStyle.participants.iconSize Layout.alignment: Qt.AlignTop clip: false @@ -159,7 +170,7 @@ Loader{ Text { id: participantsList Layout.fillWidth: true - Layout.preferredHeight: ChatCalendarMessageStyle.lineHeight + Layout.preferredHeight: parent.participantLineHeight Layout.topMargin: 4 Layout.alignment: Qt.AlignTop visible: !mainItem.isExpanded @@ -170,7 +181,7 @@ Loader{ } ScrollableListView{ id: expandedParticipantsList - property int minimumHeight: Math.min( count * ChatCalendarMessageStyle.lineHeight, layout.height/(descriptionTitle.visible?3:2)) + property int minimumHeight: Math.min( count * parent.participantLineHeight, layout.height/(descriptionTitle.visible?3:2)) Layout.fillWidth: true Layout.topMargin: 4 Layout.minimumHeight: minimumHeight @@ -182,17 +193,17 @@ Loader{ delegate: Row{ spacing: 5 width: expandedParticipantsList.contentWidth - height: ChatCalendarMessageStyle.lineHeight + height: participantsRow.participantLineHeight Text{ id: displayName - height: ChatCalendarMessageStyle.lineHeight + height: participantsRow.participantLineHeight text: modelData.displayName color: ChatCalendarMessageStyle.participants.color font.pointSize: ChatCalendarMessageStyle.participants.pointSize elide: Text.ElideRight } Text{ - height: ChatCalendarMessageStyle.lineHeight + height: participantsRow.participantLineHeight width: expandedParticipantsList.contentWidth - displayName.width - parent.spacing // parent.width is not enough. Force width text: '('+modelData.address+')' color: ChatCalendarMessageStyle.participants.color @@ -203,7 +214,7 @@ Loader{ } Item{ Layout.preferredWidth: expandButton.iconSize - Layout.preferredHeight: ChatCalendarMessageStyle.lineHeight + Layout.preferredHeight: participantsRow.participantLineHeight Layout.alignment: Qt.AlignTop | Qt.AlignRight ActionButton{ @@ -213,17 +224,13 @@ Loader{ anchors.verticalCenter: parent.verticalCenter isCustom: true colorSet: mainItem.gotoButtonMode == 0 ? ChatCalendarMessageStyle.gotoButton : ChatCalendarMessageStyle.infoButton - iconSize: ChatCalendarMessageStyle.lineHeight + iconSize: participantsRow.participantLineHeight backgroundRadius: width/2 toggled: mainItem.isExpanded onClicked: mainItem.expandToggle() } } } - Item{ - Layout.fillHeight: true - Layout.minimumHeight: 0 - } ColumnLayout{ id: expandedDescription Layout.fillWidth: true @@ -232,7 +239,9 @@ Loader{ Layout.topMargin: 5 visible: mainItem.isExpanded spacing: 0 - + // Fix for binding loops + onVisibleChanged: Qt.callLater( layout.updateFitHeight) + onImplicitHeightChanged: Qt.callLater( layout.updateFitHeight) Text{ id: descriptionTitle Layout.fillWidth: true @@ -248,7 +257,8 @@ Loader{ TextAreaField{ id: description Layout.fillWidth: true - Layout.fillHeight: true + //Layout.fillHeight: true + Layout.preferredHeight: visible ? implicitHeight : 0 Layout.leftMargin: 10 Layout.rightMargin: 10 padding: 0 @@ -258,13 +268,13 @@ Loader{ font.pointSize: ChatCalendarMessageStyle.description.pointSize border.width: 0 visible: description.text != '' - text: mainItem.conferenceInfoModel.description } Text{ id: linkTitle Layout.fillWidth: true Layout.leftMargin: 10 + Layout.topMargin: 5 color: ChatCalendarMessageStyle.subject.color font.pointSize: ChatCalendarMessageStyle.subject.pointSize font.weight: Font.Bold @@ -300,6 +310,7 @@ Loader{ RowLayout{ Layout.fillWidth: true Layout.topMargin: 10 + Layout.bottomMargin: 5 Layout.rightMargin: 10 spacing: 10 Item{ @@ -315,7 +326,7 @@ Loader{ isCustom: true colorSet: ChatCalendarMessageStyle.editButton backgroundRadius: width/2 - visible: UtilsCpp.isMe(mainItem.conferenceInfoModel.organizer) + visible: UtilsCpp.isMe(mainItem.conferenceInfoModel.organizer) && mainItem.conferenceInfoModel.endDateTime >= new Date() onClicked: { window.detachVirtualWindow() window.attachVirtualWindow(Utils.buildAppDialogUri('NewConference') diff --git a/linphone-app/ui/views/App/Main/Conferences.qml b/linphone-app/ui/views/App/Main/Conferences.qml index 43828f597..0eaf70a16 100644 --- a/linphone-app/ui/views/App/Main/Conferences.qml +++ b/linphone-app/ui/views/App/Main/Conferences.qml @@ -11,7 +11,7 @@ import App.Styles 1.0 // ============================================================================= Item{ - + ColumnLayout { id: mainItem property int filterType: -1 @@ -59,10 +59,10 @@ Item{ ExclusiveButtons { texts: [ - //: 'Finished' : Filter conferences on end status. + //: 'Finished' : Filter conferences on end status. qsTr('conferencesEndedFilter'), - - //: 'Scheduled' : Filter conferences on scheduled status. + + //: 'Scheduled' : Filter conferences on scheduled status. qsTr('conferencesScheduledFilter'), ] capitalization: Font.AllUppercase @@ -94,7 +94,7 @@ Item{ section { criteria: ViewSection.FullString delegate: sectionHeading - property: '$modelKey' + property: '$sectionDate' } model: ConferenceInfoProxyModel{ @@ -151,44 +151,35 @@ Item{ //---------------------------------------------------------------------------------------------- delegate: Item { - implicitHeight: calendarGrid.height + ConferencesStyle.conference.bottomMargin + height: entry.height + ConferencesStyle.conference.bottomMargin anchors { left: parent ? parent.left : undefined leftMargin: 10 right: parent ? parent.right : undefined rightMargin: 10 } - GridView{ - id: calendarGrid - property bool expanded : false //anchors.fill: parent - cellWidth: width/2 - cellHeight: expanded ? 460 : 90 - model: $modelData - height: cellHeight * Math.floor( (count+1) / 2) - width: mainItem.width - 20 - delegate:Rectangle { - id: entry - - width: calendarGrid.cellWidth-10 - height: calendarGrid.cellHeight-10 - radius: 6 - color: mainItem.filterType == ConferenceInfoProxyModel.Ended ? ConferencesStyle.conference.backgroundColor.ended - : ConferencesStyle.conference.backgroundColor.scheduled - border.color: calendarMessage.containsMouse || calendarMessage.isExpanded ? ConferencesStyle.conference.selectedBorder.color : 'transparent' - border.width: ConferencesStyle.conference.selectedBorder.width - ChatCalendarMessage{ - id: calendarMessage - anchors.centerIn: parent - width: parent.width - height: parent.height - conferenceInfoModel: $modelData - gotoButtonMode: mainItem.filterType == ConferenceInfoProxyModel.Scheduled || mainItem.filterType == ConferenceInfoProxyModel.Ended? 1 - : 0 - onExpandToggle: calendarGrid.expanded = !calendarGrid.expanded - isExpanded: calendarGrid.expanded - //: 'Conference URL has been copied' : Message text in a banner to warn the user that the µURL have been copied to the clipboard. - onConferenceUriCopied: messageBanner.noticeBannerText = qsTr('conferencesCopiedURL') - } + Rectangle { + id: entry + anchors.centerIn: parent + width: parent.width / 2 + height: calendarMessage.height + radius: 6 + color: mainItem.filterType == ConferenceInfoProxyModel.Ended ? ConferencesStyle.conference.backgroundColor.ended + : ConferencesStyle.conference.backgroundColor.scheduled + border.color: calendarMessage.containsMouse || calendarMessage.isExpanded ? ConferencesStyle.conference.selectedBorder.color : 'transparent' + border.width: ConferencesStyle.conference.selectedBorder.width + ChatCalendarMessage{ + id: calendarMessage + anchors.centerIn: parent + width: parent.width + height: fitHeight + conferenceInfoModel: $modelData + gotoButtonMode: mainItem.filterType == ConferenceInfoProxyModel.Scheduled || mainItem.filterType == ConferenceInfoProxyModel.Ended? 1 + : 0 + onExpandToggle: isExpanded = !isExpanded + //isExpanded: calendarGrid.expanded + //: 'Conference URL has been copied' : Message text in a banner to warn the user that the µURL have been copied to the clipboard. + onConferenceUriCopied: messageBanner.noticeBannerText = qsTr('conferencesCopiedURL') } } }