mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
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.
This commit is contained in:
parent
ff3ff7fe4f
commit
23a4374364
9 changed files with 125 additions and 230 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ConferenceInfoMapModel.hpp"
|
||||
#include "ConferenceInfoListModel.hpp"
|
||||
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQuickWindow>
|
||||
|
|
@ -34,11 +34,10 @@
|
|||
|
||||
#include "ConferenceInfoProxyModel.hpp"
|
||||
#include "ConferenceInfoModel.hpp"
|
||||
#include "ConferenceInfoProxyListModel.hpp"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
ConferenceInfoMapModel::ConferenceInfoMapModel (QObject *parent) : ProxyAbstractMapModel<QDate,SortFilterAbstractProxyModel<ProxyListModel>*>(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<linphone::ConferenceInfo> & conferenceInfo, const bool& sendEvents){
|
||||
void ConferenceInfoListModel::add(const std::shared_ptr<linphone::ConferenceInfo> & conferenceInfo, const bool& sendEvents){
|
||||
auto me = CoreManager::getInstance()->getCore()->getDefaultAccount()->getParams()->getIdentityAddress();
|
||||
std::list<std::shared_ptr<linphone::Address>> participants = conferenceInfo->getParticipants();
|
||||
bool haveMe = conferenceInfo->getOrganizer()->weakEqual(me);
|
||||
|
|
@ -57,24 +56,24 @@ void ConferenceInfoMapModel::add(const std::shared_ptr<linphone::ConferenceInfo>
|
|||
}) != 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<ConferenceInfoProxyListModel*>(mMappedList[conferenceDateTimeSystem]), &ConferenceInfoProxyListModel::onRemoved);
|
||||
ProxyListModel::add(conferenceInfoModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QHash<int, QByteArray> ConferenceInfoListModel::roleNames () const{
|
||||
QHash<int, QByteArray> 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<ConferenceInfoModel>()->getDateTimeUtc().date());
|
||||
return QVariant();
|
||||
}
|
||||
|
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#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 <linphone++/linphone.hh>
|
||||
#include <QDate>
|
||||
|
||||
#include "app/proxyModel/ProxyAbstractMapModel.hpp"
|
||||
#include "app/proxyModel/ProxyAbstractListModel.hpp"
|
||||
#include "app/proxyModel/ProxyListModel.hpp"
|
||||
#include "app/proxyModel/SortFilterAbstractProxyModel.hpp"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
class ConferenceInfoMapModel : public ProxyAbstractMapModel<QDate,SortFilterAbstractProxyModel<ProxyListModel>*> {
|
||||
class ConferenceInfoListModel : public ProxyListModel {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ConferenceInfoMapModel (QObject *parent = Q_NULLPTR);
|
||||
ConferenceInfoListModel (QObject *parent = Q_NULLPTR);
|
||||
void add(const std::shared_ptr<linphone::ConferenceInfo> & conferenceInfo, const bool& sendEvents = true);
|
||||
|
||||
QHash<int, QByteArray> 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
|
||||
|
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#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<ProxyListModel>(new ProxyListModel(parent), parent) {
|
||||
}
|
||||
|
||||
bool ConferenceInfoProxyListModel::filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const {
|
||||
auto listModel = qobject_cast<ProxyListModel*>(sourceModel());
|
||||
if(listModel){
|
||||
QModelIndex index = listModel->index(sourceRow, 0, QModelIndex());
|
||||
const ConferenceInfoModel* ics = sourceModel()->data(index).value<ConferenceInfoModel*>();
|
||||
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<ConferenceInfoModel*>();
|
||||
const ConferenceInfoModel* b = sourceModel()->data(right).value<ConferenceInfoModel*>();
|
||||
return a->getDateTimeUtc() < b->getDateTimeUtc();
|
||||
}
|
||||
|
||||
void ConferenceInfoProxyListModel::onRemoved(){
|
||||
auto model = qobject_cast<ConferenceInfoModel*>(sender());
|
||||
remove<ConferenceInfoModel*>(model);
|
||||
}
|
||||
|
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFERENCE_INFO_PROXY_LIST_MODEL_H_
|
||||
#define CONFERENCE_INFO_PROXY_LIST_MODEL_H_
|
||||
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QSharedPointer>
|
||||
|
||||
#include "ConferenceInfoModel.hpp"
|
||||
#include "app/proxyModel/SortFilterAbstractProxyModel.hpp"
|
||||
|
||||
|
||||
// =============================================================================
|
||||
|
||||
class QWindow;
|
||||
class ProxyListModel;
|
||||
|
||||
|
||||
class ConferenceInfoProxyListModel : public SortFilterAbstractProxyModel<ProxyListModel> {
|
||||
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
|
||||
|
|
@ -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<ConferenceInfoMapModel>(new ConferenceInfoMapModel(parent), parent) {
|
||||
ConferenceInfoProxyModel::ConferenceInfoProxyModel (QObject *parent) : SortFilterAbstractProxyModel<ConferenceInfoListModel>(new ConferenceInfoListModel(parent), parent) {
|
||||
connect(CoreManager::getInstance()->getAccountSettingsModel(), &AccountSettingsModel::primarySipAddressChanged, this, &ConferenceInfoProxyModel::update);
|
||||
connect(this, &ConferenceInfoProxyModel::filterTypeChanged, qobject_cast<ConferenceInfoMapModel*>(sourceModel()), &ConferenceInfoMapModel::filterTypeChanged);
|
||||
//connect(this, &ConferenceInfoProxyModel::filterTypeChanged, qobject_cast<ConferenceInfoListModel*>(sourceModel()), &ConferenceInfoListModel);
|
||||
connect(CoreManager::getInstance()->getHandlers().get(), &CoreHandlers::conferenceInfoReceived, this, &ConferenceInfoProxyModel::onConferenceInfoReceived);
|
||||
setFilterType((int)Scheduled);
|
||||
}
|
||||
|
||||
void ConferenceInfoProxyModel::update(){
|
||||
int oldFilter = getFilterType();
|
||||
SortFilterAbstractProxyModel<ConferenceInfoMapModel>::update(new ConferenceInfoMapModel(parent()));
|
||||
SortFilterAbstractProxyModel<ConferenceInfoListModel>::update(new ConferenceInfoListModel(parent()));
|
||||
setFilterType(oldFilter+1);
|
||||
connect(this, &ConferenceInfoProxyModel::filterTypeChanged, qobject_cast<ConferenceInfoMapModel*>(sourceModel()), &ConferenceInfoMapModel::filterTypeChanged);
|
||||
//connect(this, &ConferenceInfoProxyModel::filterTypeChanged, qobject_cast<ConferenceInfoListModel*>(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<ConferenceInfoMapModel*>();
|
||||
if(ics){
|
||||
int r = ics->rowCount();
|
||||
return r > 0;
|
||||
}
|
||||
const ConferenceInfoProxyListModel* listModel = sourceModel()->data(index).value<ConferenceInfoProxyListModel*>();
|
||||
auto listModel = qobject_cast<ProxyListModel*>(sourceModel());
|
||||
if(listModel){
|
||||
int r = listModel->rowCount();
|
||||
return r > 0;
|
||||
QModelIndex index = listModel->index(sourceRow, 0, QModelIndex());
|
||||
const ConferenceInfoModel* ics = sourceModel()->data(index).value<ConferenceInfoModel*>();
|
||||
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<ConferenceInfoModel*>();
|
||||
const ConferenceInfoModel* b = sourceModel()->data(right).value<ConferenceInfoModel*>();
|
||||
return a->getDateTimeUtc() < b->getDateTimeUtc();
|
||||
}
|
||||
|
||||
void ConferenceInfoProxyModel::onConferenceInfoReceived(const std::shared_ptr<const linphone::ConferenceInfo> & conferenceInfo){
|
||||
auto realConferenceInfo = ConferenceInfoModel::findConferenceInfo(conferenceInfo);
|
||||
if( realConferenceInfo ){
|
||||
auto model = qobject_cast<ConferenceInfoMapModel*>(sourceModel());
|
||||
auto model = qobject_cast<ConferenceInfoListModel*>(sourceModel());
|
||||
model->add(realConferenceInfo);
|
||||
}else
|
||||
qWarning() << "No conferenceInfo have beend found for " << conferenceInfo->getUri()->asString().c_str();
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@
|
|||
// =============================================================================
|
||||
|
||||
class QWindow;
|
||||
class ConferenceInfoMapModel;
|
||||
class ConferenceInfoListModel;
|
||||
|
||||
|
||||
class ConferenceInfoProxyModel : public SortFilterAbstractProxyModel<ConferenceInfoMapModel> {
|
||||
class ConferenceInfoProxyModel : public SortFilterAbstractProxyModel<ConferenceInfoListModel> {
|
||||
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:
|
||||
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue