summary refs log tree commit diff
diff options
context:
space:
mode:
authortargetakhil <targetakhil@gmail.com>2021-04-15 22:32:37 +0530
committertargetakhil <targetakhil@gmail.com>2021-04-15 22:37:47 +0530
commit99340047026b6980c14f83471dfa63369f8eae96 (patch)
treecf032901014aa98757a994ca12ebf743d85b0181
parentAdded overlay and UI changes (diff)
downloadnheko-99340047026b6980c14f83471dfa63369f8eae96.tar.xz
remove unused function and set position to center of timeline view
-rw-r--r--resources/qml/ForwardCompleter.qml10
-rw-r--r--src/timeline/TimelineModel.cpp11
-rw-r--r--src/timeline/TimelineModel.h1
3 files changed, 7 insertions, 15 deletions
diff --git a/resources/qml/ForwardCompleter.qml b/resources/qml/ForwardCompleter.qml
index 4cc2e09d..f85362c1 100644
--- a/resources/qml/ForwardCompleter.qml
+++ b/resources/qml/ForwardCompleter.qml
@@ -9,11 +9,12 @@ import im.nheko 1.0
 
 Popup {
     id: forwardMessagePopup
+
+    x: Math.round(parent.width / 2 - width / 2)
+    y: Math.round(parent.height / 2 - height / 2)
+    modal: true
     palette: colors
     parent: Overlay.overlay
-    modal: true
-    x: 400
-    y: 200
 
     width: implicitWidth >= 300 ? implicitWidth : 300
     height: implicitHeight + completerPopup.height + padding * 2
@@ -37,10 +38,12 @@ Popup {
 
     Column {
         id: forwardColumn
+
         spacing: 5
 
         Label {
             id: titleLabel
+
             text: qsTr("Forward Message")
             font.bold: true
             bottomPadding: 10
@@ -48,6 +51,7 @@ Popup {
 
         Reply {
             id: replyPreview
+
             modelData: TimelineManager.timeline ? TimelineManager.timeline.getDump(mid, "") : {
             }
             userColor: TimelineManager.userColor(modelData.userId, colors.window)
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index 0edee4aa..e3efe5ad 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -832,17 +832,6 @@ TimelineModel::forwardMessage(QString eventId, QString roomId)
         emit forwardToRoom(e, roomId, cache::isRoomEncrypted(room_id_.toStdString()));
 }
 
-QString
-TimelineModel::messageContent(QString eventId)
-{
-        auto e = events.get(eventId.toStdString(), "");
-        if (!e)
-                return "";
-
-        auto content = mtx::accessors::body(*e);
-        return QString::fromStdString(content);
-}
-
 void
 TimelineModel::viewDecryptedRawMessage(QString id) const
 {
diff --git a/src/timeline/TimelineModel.h b/src/timeline/TimelineModel.h
index c17280da..3e6f6f15 100644
--- a/src/timeline/TimelineModel.h
+++ b/src/timeline/TimelineModel.h
@@ -220,7 +220,6 @@ public:
 
         Q_INVOKABLE void viewRawMessage(QString id) const;
         Q_INVOKABLE void forwardMessage(QString eventId, QString roomId);
-        Q_INVOKABLE QString messageContent(QString eventId);
         Q_INVOKABLE void viewDecryptedRawMessage(QString id) const;
         Q_INVOKABLE void openUserProfile(QString userid, bool global = false);
         Q_INVOKABLE void openRoomSettings();