diff --git a/qml/components/MessageListViewItem.qml b/qml/components/MessageListViewItem.qml
index a2c4341..61c7cb4 100644
--- a/qml/components/MessageListViewItem.qml
+++ b/qml/components/MessageListViewItem.qml
@@ -97,16 +97,6 @@ ListItem {
}
sourceComponent: Component {
ContextMenu {
- Repeater {
- model: (extraContentLoader.item && ("extraContextMenuItems" in extraContentLoader.item)) ?
- extraContentLoader.item.extraContextMenuItems : 0
- delegate: MenuItem {
- visible: modelData.visible
- text: modelData.name
- onClicked: modelData.action()
- }
- }
-
MenuItem {
visible: messageListItem.canReplyToMessage
onClicked: messageListItem.replyToMessage()
@@ -127,32 +117,13 @@ ListItem {
onClicked: {
messageOptionsDrawer.myMessage = myMessage;
messageOptionsDrawer.userInformation = userInformation;
+ messageOptionsDrawer.sourceItem = messageListItem
+ messageOptionsDrawer.additionalItemsModel = (extraContentLoader.item && ("extraContextMenuItems" in extraContentLoader.item)) ? extraContentLoader.item.extraContextMenuItems : 0;
messageListItem.highlighted = true;
messageOptionsDrawer.open = true;
}
text: qsTr("More Options...")
}
- MenuItem {
- onClicked: {
- if (myMessage.is_pinned) {
- Remorse.popupAction(page, qsTr("Message unpinned"), function() { tdLibWrapper.unpinMessage(page.chatInformation.id, messageId);
- pinnedMessageItem.requestCloseMessage(); } );
- } else {
- tdLibWrapper.pinMessage(page.chatInformation.id, messageId);
- }
- }
- text: myMessage.is_pinned ? qsTr("Unpin Message") : qsTr("Pin Message")
- visible: canPinMessages()
- }
- MenuItem {
- onClicked: {
- var chatId = page.chatInformation.id;
- var messageId = messageListItem.messageId;
- Remorse.itemAction(messageListItem, qsTr("Message deleted"), function() { tdLibWrapper.deleteMessages(chatId, [ messageId]); })
- }
- text: qsTr("Delete Message")
- visible: myMessage.can_be_deleted_for_all_users || (myMessage.can_be_deleted_only_for_self && myMessage.chat_id === page.myUserId)
- }
}
}
}
diff --git a/qml/pages/ChatPage.qml b/qml/pages/ChatPage.qml
index 477d0e2..a91f5dd 100644
--- a/qml/pages/ChatPage.qml
+++ b/qml/pages/ChatPage.qml
@@ -686,54 +686,31 @@ Page {
property var myMessage: ({})
property var userInformation: ({})
+ property var additionalItemsModel: 0
+ property var sourceItem
signal closeRequested();
+ function closeDrawer() {
+ messageOptionsDrawer.closeRequested();
+ messageOptionsDrawer.open = false;
+ }
+
anchors.fill: parent
- dock: chatPage.isPortrait ? Dock.Top : Dock.Right
+ dock: chatPage.isPortrait ? Dock.Bottom : Dock.Right
+ backgroundSize: dock == Dock.Left || dock == Dock.Right ? width / 2 : height / 3
- background: SilicaListView {
+ background: Column {
anchors.fill: parent
- model: ListModel {
- id: myListModel
- property var actions: {
- "copyToClipboard": function() { Clipboard.text = Functions.getMessageText(messageOptionsDrawer.myMessage, true, messageOptionsDrawer.userInformation.id, true) },
- "pinMessage": function() {
- if (messageOptionsDrawer.myMessage.is_pinned) {
- Remorse.popupAction(page, qsTr("Message unpinned"), function() { tdLibWrapper.unpinMessage(chatPage.chatInformation.id, messageOptionsDrawer.myMessage.id);
- pinnedMessageItem.requestCloseMessage(); } );
- } else {
- tdLibWrapper.pinMessage(chatPage.chatInformation.id, messageOptionsDrawer.myMessage.id);
- }
- }
- }
- property var conditions: {
- "copyToClipboard": function() { return true; },
- "pinMessage": function() { return canPinMessages(); }
- }
-
- property var texts: {
- "copyToClipboard": function() { return qsTr("Copy Message to Clipboard"); },
- "pinMessage": function() { return messageOptionsDrawer.myMessage.is_pinned ? qsTr("Unpin Message") : qsTr("Pin Message"); }
- }
-
- ListElement {
- elementActionName: "copyToClipboard"
- }
-
- ListElement {
- elementActionName: "pinMessage"
- }
- }
-
- header: Row {
- width: parent.width - ( 4 * Theme.horizontalPageMargin)
+ Row {
+ id: drawerHeaderRow
+ width: parent.width - ( 2 * Theme.horizontalPageMargin)
height: messageOptionsLabel.height + Theme.paddingLarge + ( chatPage.isPortrait ? ( 2 * Theme.paddingSmall ) : 0 )
anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.paddingMedium
Label {
id: messageOptionsLabel
- text: qsTr("Message Options")
+ text: qsTr("Additional Options")
color: Theme.highlightColor
font.pixelSize: Theme.fontSizeLarge
width: parent.width - closeMessageOptionsButton.width - Theme.paddingMedium
@@ -746,28 +723,93 @@ Page {
icon.source: "image://theme/icon-m-clear"
anchors.verticalCenter: parent.verticalCenter
onClicked: {
- messageOptionsDrawer.closeRequested();
- messageOptionsDrawer.open = false;
+ messageOptionsDrawer.closeDrawer();
}
}
}
- delegate: ListItem {
+ Flickable {
+ id: drawerFlickable
width: parent.width
- visible: myListModel.actions[conditions]()
- onClicked: {
- myListModel.actions[elementActionName]();
- }
- Label {
- width: parent.width - ( 2 * Theme.horizontalPageMargin )
- text: myListModel.texts[elementActionName]();
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- horizontalAlignment: Text.AlignHCenter
- }
- }
+ height: parent.height - drawerHeaderRow.height
+ contentHeight: drawerContentColumn.height
+ clip: true
+ Column {
+ id: drawerContentColumn
+ width: parent.width
+ Repeater {
+ model: messageOptionsDrawer.additionalItemsModel
+ delegate: BackgroundItem {
+ width: parent.width
+ visible: modelData.visible
+ onClicked: {
+ modelData.action();
+ messageOptionsDrawer.closeDrawer();
+ }
+ Label {
+ width: parent.width - ( 2 * Theme.horizontalPageMargin )
+ text: modelData.name
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ horizontalAlignment: Text.AlignHCenter
+ }
+ }
+ }
+ BackgroundItem {
+ width: parent.width
+ onClicked: {
+ Clipboard.text = Functions.getMessageText(messageOptionsDrawer.myMessage, true, messageOptionsDrawer.userInformation.id, true);
+ messageOptionsDrawer.closeDrawer();
+ }
+ Label {
+ width: parent.width - ( 2 * Theme.horizontalPageMargin )
+ text: qsTr("Copy Message to Clipboard")
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ horizontalAlignment: Text.AlignHCenter
+ }
+ }
+ BackgroundItem {
+ width: parent.width
+ visible: canPinMessages()
+ onClicked: {
+ if (messageOptionsDrawer.myMessage.is_pinned) {
+ Remorse.popupAction(page, qsTr("Message unpinned"), function() { tdLibWrapper.unpinMessage(chatPage.chatInformation.id, messageOptionsDrawer.myMessage.id);
+ pinnedMessageItem.requestCloseMessage(); } );
+ } else {
+ tdLibWrapper.pinMessage(chatPage.chatInformation.id, messageOptionsDrawer.myMessage.id);
+ }
+ messageOptionsDrawer.closeDrawer();
+ }
+ Label {
+ width: parent.width - ( 2 * Theme.horizontalPageMargin )
+ text: messageOptionsDrawer.myMessage.is_pinned ? qsTr("Unpin Message") : qsTr("Pin Message")
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ horizontalAlignment: Text.AlignHCenter
+ }
+ }
+ BackgroundItem {
+ width: parent.width
+ visible: messageOptionsDrawer.myMessage.can_be_deleted_for_all_users || (messageOptionsDrawer.myMessage.can_be_deleted_only_for_self && messageOptionsDrawer.myMessage.chat_id === chatPage.myUserId)
+ onClicked: {
+ var chatId = page.chatInformation.id;
+ var messageId = messageOptionsDrawer.myMessage.id;
+ Remorse.itemAction(messageOptionsDrawer.sourceItem, qsTr("Message deleted"), function() { tdLibWrapper.deleteMessages(chatId, [ messageId ]); });
+ messageOptionsDrawer.closeDrawer();
+ }
+ Label {
+ width: parent.width - ( 2 * Theme.horizontalPageMargin )
+ text: qsTr("Delete Message")
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ horizontalAlignment: Text.AlignHCenter
+ }
+ }
- VerticalScrollDecorator {}
+ }
+ VerticalScrollDecorator {}
+ }
}
SilicaFlickable {
diff --git a/translations/harbour-fernschreiber-de.ts b/translations/harbour-fernschreiber-de.ts
index f15679a..61604bc 100644
--- a/translations/harbour-fernschreiber-de.ts
+++ b/translations/harbour-fernschreiber-de.ts
@@ -437,11 +437,31 @@
- Nachricht in die Zwischenablage kopieren
+ Nachricht in die Zwischenablage kopieren
-
-
+
+ Nachricht losgeheftet
+
+
+
+ Nachricht losheften
+
+
+
+ Nachricht anheften
+
+
+
+ Zusätzliche Optionen
+
+
+
+ Nachricht gelöscht
+
+
+
+ Nachricht löschen
@@ -963,18 +983,6 @@
Nachricht bearbeiten
-
-
- Nachricht in die Zwischenablage kopieren
-
-
-
- Nachricht gelöscht
-
-
-
- Nachricht löschen
-
Sie
@@ -987,21 +995,9 @@
Nachricht auswählen
-
-
- Nachricht anheften
-
-
-
- Nachricht losgeheftet
-
-
-
- Nachricht losheften
-
-
+ Mehr Optionen...
diff --git a/translations/harbour-fernschreiber-en.ts b/translations/harbour-fernschreiber-en.ts
index 4785223..5c1938c 100644
--- a/translations/harbour-fernschreiber-en.ts
+++ b/translations/harbour-fernschreiber-en.ts
@@ -437,11 +437,31 @@
- Copy Message to Clipboard
+ Copy Message to Clipboard
-
-
+
+ Message unpinned
+
+
+
+ Unpin Message
+
+
+
+ Pin Message
+
+
+
+ Additional Options
+
+
+
+ Message deleted
+
+
+
+ Delete Message
@@ -965,18 +985,6 @@ messages
Edit Message
-
-
- Copy Message to Clipboard
-
-
-
- Message deleted
-
-
-
- Delete Message
-
You
@@ -989,21 +997,9 @@ messages
Select Message
-
-
- Pin Message
-
-
-
- Message unpinned
-
-
-
- Unpin Message
-
-
+ More Options...
diff --git a/translations/harbour-fernschreiber-es.ts b/translations/harbour-fernschreiber-es.ts
index aa9b741..fd979a2 100644
--- a/translations/harbour-fernschreiber-es.ts
+++ b/translations/harbour-fernschreiber-es.ts
@@ -440,9 +440,29 @@
Copiar
-
+
+ Mensaje desanclado
+
+
+
+ Desanclar mensaje
+
+
+
+ Anclar mensaje
+
+
+
+
+
+ Mensaje borrado
+
+
+
+ Borrar
+
ChatSelectionPage
@@ -963,18 +983,6 @@
Editar
-
-
- Copiar
-
-
-
- Mensaje borrado
-
-
-
- Borrar
-
Usted
@@ -987,18 +995,6 @@
Seleccionar
-
-
- Anclar mensaje
-
-
-
- Mensaje desanclado
-
-
-
- Desanclar mensaje
-
diff --git a/translations/harbour-fernschreiber-fi.ts b/translations/harbour-fernschreiber-fi.ts
index 093bc77..a9a4acd 100644
--- a/translations/harbour-fernschreiber-fi.ts
+++ b/translations/harbour-fernschreiber-fi.ts
@@ -440,9 +440,29 @@
Kopioi viesti leikepöydälle
-
+
+ Viestin kiinnitys poistettu
+
+
+
+ Poista viestin kiinnitys
+
+
+
+ Kiinnitä viesti
+
+
+
+
+
+ Viesti poistettu
+
+
+
+ Poista viesti
+
ChatSelectionPage
@@ -964,18 +984,6 @@
Muokkaa viestiä
-
-
- Kopioi viesti leikepöydälle
-
-
-
- Viesti poistettu
-
-
-
- Poista viesti
-
Sinä
@@ -988,18 +996,6 @@
Valitse viesti
-
-
- Kiinnitä viesti
-
-
-
- Viestin kiinnitys poistettu
-
-
-
- Poista viestin kiinnitys
-
diff --git a/translations/harbour-fernschreiber-hu.ts b/translations/harbour-fernschreiber-hu.ts
index 31173e4..4617ee6 100644
--- a/translations/harbour-fernschreiber-hu.ts
+++ b/translations/harbour-fernschreiber-hu.ts
@@ -430,9 +430,29 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Üzenet törlése
+
ChatSelectionPage
@@ -949,18 +969,6 @@
Üzenet szerkesztése
-
-
-
-
-
-
-
-
-
-
- Üzenet törlése
-
Te
@@ -973,18 +981,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/translations/harbour-fernschreiber-it.ts b/translations/harbour-fernschreiber-it.ts
index 366d1a7..23b9379 100644
--- a/translations/harbour-fernschreiber-it.ts
+++ b/translations/harbour-fernschreiber-it.ts
@@ -440,9 +440,29 @@
Copia messaggio nella clipboard
-
+
+ Messaggio non più in evidenza
+
+
+
+ Togli messaggio in evidenza
+
+
+
+ Metti messaggio in evidenza
+
+
+
+
+
+ Messaggio cancellato
+
+
+
+ Cancella messaggio
+
ChatSelectionPage
@@ -963,18 +983,6 @@
Modifica messaggio
-
-
- Copia messaggio nella clipboard
-
-
-
- Messaggio cancellato
-
-
-
- Cancella messaggio
-
Tu
@@ -987,18 +995,6 @@
Seleziona messaggio
-
-
- Metti messaggio in evidenza
-
-
-
- Messaggio non più in evidenza
-
-
-
- Togli messaggio in evidenza
-
diff --git a/translations/harbour-fernschreiber-pl.ts b/translations/harbour-fernschreiber-pl.ts
index f0acce1..4869f04 100644
--- a/translations/harbour-fernschreiber-pl.ts
+++ b/translations/harbour-fernschreiber-pl.ts
@@ -450,9 +450,29 @@
Skopiuj wiadomość do schowka
-
+
+ Wiadomość opięta
+
+
+
+ Odepnij wiadomość
+
+
+
+ Przypnij wiadomość
+
+
+
+
+
+ Wiadomość usunięta
+
+
+
+ Usuń wiadomość
+
ChatSelectionPage
@@ -977,18 +997,6 @@
Edytuj widomość
-
-
- Skopiuj wiadomość do schowka
-
-
-
- Wiadomość usunięta
-
-
-
- Usuń wiadomość
-
Ty
@@ -1001,18 +1009,6 @@
Wybierz wiadomość
-
-
- Przypnij wiadomość
-
-
-
- Wiadomość odpięta
-
-
-
- Odepnij wiadomość
-
diff --git a/translations/harbour-fernschreiber-ru.ts b/translations/harbour-fernschreiber-ru.ts
index 84182ef..0c0b046 100644
--- a/translations/harbour-fernschreiber-ru.ts
+++ b/translations/harbour-fernschreiber-ru.ts
@@ -450,9 +450,29 @@
Скопировать в буфер обмена
-
+
+ Сообщение откреплено
+
+
+
+ Открепить сообщение
+
+
+
+ Закрепить сообщение
+
+
+
+
+
+ Сообщение удалено
+
+
+
+ Удалить
+
ChatSelectionPage
@@ -980,18 +1000,6 @@
Редактировать
-
-
- Скопировать в буфер обмена
-
-
-
- Сообщение удалено
-
-
-
- Удалить
-
Вы
@@ -1004,18 +1012,6 @@
Выбрать сообщение
-
-
- Закрепить сообщение
-
-
-
- Сообщение откреплено
-
-
-
- Открепить сообщение
-
diff --git a/translations/harbour-fernschreiber-sk.ts b/translations/harbour-fernschreiber-sk.ts
index 56cf8f9..ce27ea6 100644
--- a/translations/harbour-fernschreiber-sk.ts
+++ b/translations/harbour-fernschreiber-sk.ts
@@ -450,9 +450,29 @@
Kopírovať správu do schránky
-
+
+ Správa bola odopnutá
+
+
+
+ Odopnúť správu
+
+
+
+ Pripnúť správu
+
+
+
+
+
+ Správa bola odstránená
+
+
+
+ Odstrániť správu
+
ChatSelectionPage
@@ -977,18 +997,6 @@
Upraviť správu
-
-
- Kopírovať správu do schránky
-
-
-
- Správa bola odstránená
-
-
-
- Odstrániť správu
-
Ja
@@ -1001,18 +1009,6 @@
Vybrať správu
-
-
- Pripnúť správu
-
-
-
- Správa bola odopnutá
-
-
-
- Odopnúť správu
-
diff --git a/translations/harbour-fernschreiber-sv.ts b/translations/harbour-fernschreiber-sv.ts
index 910c4b9..16911ce 100644
--- a/translations/harbour-fernschreiber-sv.ts
+++ b/translations/harbour-fernschreiber-sv.ts
@@ -440,9 +440,29 @@
Kopiera meddelandet till urklipp
-
+
+ Meddelandet lösgjort
+
+
+
+ Lösgör meddelandet
+
+
+
+ Fäst meddelandet
+
+
+
+
+
+ Mededelande borttaget
+
+
+
+ Ta bort meddelandet
+
ChatSelectionPage
@@ -963,18 +983,6 @@
Redigera meddelandet
-
-
- Kopiera meddelandet till urklipp
-
-
-
- Mededelande borttaget
-
-
-
- Ta bort meddelandet
-
Du
@@ -987,18 +995,6 @@
Markera meddelanden
-
-
- Fäst meddelandet
-
-
-
- Meddelandet lösgjort
-
-
-
- Lösgör meddelandet
-
diff --git a/translations/harbour-fernschreiber-zh_CN.ts b/translations/harbour-fernschreiber-zh_CN.ts
index 127afe2..eac8e4e 100644
--- a/translations/harbour-fernschreiber-zh_CN.ts
+++ b/translations/harbour-fernschreiber-zh_CN.ts
@@ -430,9 +430,29 @@
复制消息到剪切板
-
+
+ 已取消置顶消息
+
+
+
+ 取消置顶
+
+
+
+ 置顶消息
+
+
+
+
+
+ 已删除消息
+
+
+
+ 删除消息
+
ChatSelectionPage
@@ -950,18 +970,6 @@
编辑消息
-
-
- 复制消息到剪切板
-
-
-
- 已删除消息
-
-
-
- 删除消息
-
你
@@ -974,18 +982,6 @@
选择消息
-
-
- 置顶消息
-
-
-
- 已取消消息置顶
-
-
-
- 取消置顶
-
diff --git a/translations/harbour-fernschreiber.ts b/translations/harbour-fernschreiber.ts
index 7160831..985cbc1 100644
--- a/translations/harbour-fernschreiber.ts
+++ b/translations/harbour-fernschreiber.ts
@@ -440,9 +440,29 @@
Copy Message to Clipboard
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Message deleted
+
+
+
+ Delete Message
+
ChatSelectionPage
@@ -963,18 +983,6 @@
Edit Message
-
-
- Copy Message to Clipboard
-
-
-
- Message deleted
-
-
-
- Delete Message
-
You
@@ -987,18 +995,6 @@
Select Message
-
-
-
-
-
-
-
-
-
-
-
-