summaryrefslogtreecommitdiffstats
path: root/src/timeline
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-05-10 03:19:53 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-05-10 03:20:09 +0200
commita6b2be112b9a9450998985cbc5ec4ce10a5ae432 (patch)
treeac8f472f4a662679f3304c380e95f75d12b2415e /src/timeline
parent8f6ed458a65fa9425c80d637289151971db674d7 (diff)
More image dialog fixes
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/CommunitiesModel.cpp3
-rw-r--r--src/timeline/DelegateChooser.h3
-rw-r--r--src/timeline/InputBar.h3
-rw-r--r--src/timeline/PresenceEmitter.h3
-rw-r--r--src/timeline/TimelineModel.cpp6
-rw-r--r--src/timeline/TimelineModel.h3
-rw-r--r--src/timeline/TimelineViewManager.cpp8
-rw-r--r--src/timeline/TimelineViewManager.h12
8 files changed, 30 insertions, 11 deletions
diff --git a/src/timeline/CommunitiesModel.cpp b/src/timeline/CommunitiesModel.cpp
index 4f650f49..14909479 100644
--- a/src/timeline/CommunitiesModel.cpp
+++ b/src/timeline/CommunitiesModel.cpp
@@ -14,7 +14,8 @@
CommunitiesModel::CommunitiesModel(QObject *parent)
: QAbstractListModel(parent)
-{}
+{
+}
QHash<int, QByteArray>
CommunitiesModel::roleNames() const
diff --git a/src/timeline/DelegateChooser.h b/src/timeline/DelegateChooser.h
index 1772c0c2..8dff66ad 100644
--- a/src/timeline/DelegateChooser.h
+++ b/src/timeline/DelegateChooser.h
@@ -74,7 +74,8 @@ private:
DelegateIncubator(DelegateChooser &parent)
: QQmlIncubator(QQmlIncubator::AsynchronousIfNested)
, chooser(parent)
- {}
+ {
+ }
void statusChanged(QQmlIncubator::Status status) override;
DelegateChooser &chooser;
diff --git a/src/timeline/InputBar.h b/src/timeline/InputBar.h
index 28a4bcf6..683a2ed9 100644
--- a/src/timeline/InputBar.h
+++ b/src/timeline/InputBar.h
@@ -39,7 +39,8 @@ class InputVideoSurface : public QAbstractVideoSurface
public:
InputVideoSurface(QObject *parent)
: QAbstractVideoSurface(parent)
- {}
+ {
+ }
bool present(const QVideoFrame &frame) override;
diff --git a/src/timeline/PresenceEmitter.h b/src/timeline/PresenceEmitter.h
index 6cbfa96a..7028c501 100644
--- a/src/timeline/PresenceEmitter.h
+++ b/src/timeline/PresenceEmitter.h
@@ -19,7 +19,8 @@ class PresenceEmitter : public QObject
public:
PresenceEmitter(QObject *p = nullptr)
: QObject(p)
- {}
+ {
+ }
void sync(const std::vector<mtx::events::Event<mtx::events::presence::Presence>> &presences);
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index 142ca793..1e0893b4 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -1366,7 +1366,8 @@ struct SendMessageVisitor
{
explicit SendMessageVisitor(TimelineModel *model)
: model_(model)
- {}
+ {
+ }
template<typename T, mtx::events::EventType Event>
void sendRoomEvent(mtx::events::RoomEvent<T> msg)
@@ -1390,7 +1391,8 @@ struct SendMessageVisitor
// Do-nothing operator for all unhandled events
template<typename T>
void operator()(const mtx::events::Event<T> &)
- {}
+ {
+ }
// Operator for m.room.message events that contain a msgtype in their content
template<typename T,
diff --git a/src/timeline/TimelineModel.h b/src/timeline/TimelineModel.h
index c52473b1..646d018c 100644
--- a/src/timeline/TimelineModel.h
+++ b/src/timeline/TimelineModel.h
@@ -147,7 +147,8 @@ class StateKeeper
public:
StateKeeper(std::function<void()> &&fn)
: fn_(std::move(fn))
- {}
+ {
+ }
~StateKeeper() { fn_(); }
diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp
index 58426178..384cb3ff 100644
--- a/src/timeline/TimelineViewManager.cpp
+++ b/src/timeline/TimelineViewManager.cpp
@@ -242,13 +242,17 @@ TimelineViewManager::escapeEmoji(QString str) const
}
void
-TimelineViewManager::openImageOverlay(TimelineModel *room, QString mxcUrl, QString eventId)
+TimelineViewManager::openImageOverlay(TimelineModel *room,
+ QString mxcUrl,
+ QString eventId,
+ double originalWidth,
+ double proportionalHeight)
{
if (mxcUrl.isEmpty()) {
return;
}
- emit showImageOverlay(room, eventId, mxcUrl);
+ emit showImageOverlay(room, eventId, mxcUrl, originalWidth, proportionalHeight);
}
void
diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h
index 020bdac5..6b9d9e94 100644
--- a/src/timeline/TimelineViewManager.h
+++ b/src/timeline/TimelineViewManager.h
@@ -54,7 +54,11 @@ public:
Q_INVOKABLE bool isInitialSync() const { return isInitialSync_; }
bool isConnected() const { return isConnected_; }
- Q_INVOKABLE void openImageOverlay(TimelineModel *room, QString mxcUrl, QString eventId);
+ Q_INVOKABLE void openImageOverlay(TimelineModel *room,
+ QString mxcUrl,
+ QString eventId,
+ double originalWidth,
+ double proportionalHeight);
Q_INVOKABLE void openImagePackSettings(QString roomid);
Q_INVOKABLE void saveMedia(QString mxcUrl);
Q_INVOKABLE QColor userColor(QString id, QColor background);
@@ -87,7 +91,11 @@ signals:
void openProfile(UserProfile *profile);
void showImagePackSettings(TimelineModel *room, ImagePackListModel *packlist);
void openLeaveRoomDialog(QString roomid, QString reason = "");
- void showImageOverlay(TimelineModel *room, QString eventId, QString url);
+ void showImageOverlay(TimelineModel *room,
+ QString eventId,
+ QString url,
+ double originalWidth,
+ double proportionalHeight);
public slots:
void updateReadReceipts(const QString &room_id, const std::vector<QString> &event_ids);