Port top bar to Qml
Also fixes some resize issues with stupid workarounds to our resize logic. This really needs to be cleaned up at some point!
This commit is contained in:
parent
c4e4938d35
commit
640b0ee405
12 changed files with 267 additions and 448 deletions
|
|
@ -12,6 +12,7 @@
|
|||
#include "ColorImageProvider.h"
|
||||
#include "DelegateChooser.h"
|
||||
#include "Logging.h"
|
||||
#include "MainWindow.h"
|
||||
#include "MatrixClient.h"
|
||||
#include "MxcImageProvider.h"
|
||||
#include "UserSettingsPage.h"
|
||||
|
|
@ -76,7 +77,7 @@ TimelineViewManager::userStatus(QString id) const
|
|||
|
||||
TimelineViewManager::TimelineViewManager(QSharedPointer<UserSettings> userSettings,
|
||||
CallManager *callManager,
|
||||
QWidget *parent)
|
||||
ChatPage *parent)
|
||||
: imgProvider(new MxcImageProvider())
|
||||
, colorImgProvider(new ColorImageProvider())
|
||||
, blurhashProvider(new BlurhashProvider())
|
||||
|
|
@ -131,15 +132,12 @@ TimelineViewManager::TimelineViewManager(QSharedPointer<UserSettings> userSettin
|
|||
view->engine()->addImageProvider("blurhash", blurhashProvider);
|
||||
view->setSource(QUrl("qrc:///qml/TimelineView.qml"));
|
||||
|
||||
connect(dynamic_cast<ChatPage *>(parent),
|
||||
&ChatPage::themeChanged,
|
||||
this,
|
||||
&TimelineViewManager::updateColorPalette);
|
||||
connect(dynamic_cast<ChatPage *>(parent),
|
||||
connect(parent, &ChatPage::themeChanged, this, &TimelineViewManager::updateColorPalette);
|
||||
connect(parent,
|
||||
&ChatPage::decryptSidebarChanged,
|
||||
this,
|
||||
&TimelineViewManager::updateEncryptedDescriptions);
|
||||
connect(dynamic_cast<ChatPage *>(parent), &ChatPage::loggedOut, this, [this]() {
|
||||
connect(parent, &ChatPage::loggedOut, this, [this]() {
|
||||
isInitialSync_ = true;
|
||||
emit initialSyncChanged(true);
|
||||
});
|
||||
|
|
@ -157,6 +155,7 @@ TimelineViewManager::sync(const mtx::responses::Rooms &rooms)
|
|||
&TimelineModel::newCallEvent,
|
||||
callManager_,
|
||||
&CallManager::syncEvent);
|
||||
room_model->syncState(room.state);
|
||||
room_model->addEvents(room.timeline);
|
||||
if (!isInitialSync_)
|
||||
disconnect(room_model.data(),
|
||||
|
|
@ -245,6 +244,28 @@ TimelineViewManager::openLink(QString link) const
|
|||
QDesktopServices::openUrl(link);
|
||||
}
|
||||
|
||||
void
|
||||
TimelineViewManager::openInviteUsersDialog()
|
||||
{
|
||||
MainWindow::instance()->openInviteUsersDialog(
|
||||
[this](const QStringList &invitees) { emit inviteUsers(invitees); });
|
||||
}
|
||||
void
|
||||
TimelineViewManager::openMemberListDialog() const
|
||||
{
|
||||
MainWindow::instance()->openMemberListDialog();
|
||||
}
|
||||
void
|
||||
TimelineViewManager::openLeaveRoomDialog() const
|
||||
{
|
||||
MainWindow::instance()->openLeaveRoomDialog();
|
||||
}
|
||||
void
|
||||
TimelineViewManager::openRoomSettings() const
|
||||
{
|
||||
MainWindow::instance()->openRoomSettings();
|
||||
}
|
||||
|
||||
void
|
||||
TimelineViewManager::updateReadReceipts(const QString &room_id,
|
||||
const std::vector<QString> &event_ids)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue