fix display participant popup when typing @
restore cursor when clicking on mention (cursor was stuck on ibeam)
This commit is contained in:
parent
53c5c9cce1
commit
a51de0ff7f
7 changed files with 34 additions and 28 deletions
|
|
@ -149,7 +149,7 @@ void EventLogProxy::setDisplayItemsStep(int step) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EventLogProxy::loadUntil(int index) {
|
void EventLogProxy::loadUntil(int index) {
|
||||||
if (mMaxDisplayItems < index) setMaxDisplayItems(index + mDisplayItemsStep);
|
if (mMaxDisplayItems <= index) setMaxDisplayItems(index + mDisplayItemsStep);
|
||||||
}
|
}
|
||||||
|
|
||||||
int EventLogProxy::findFirstUnreadIndex() {
|
int EventLogProxy::findFirstUnreadIndex() {
|
||||||
|
|
@ -158,7 +158,7 @@ int EventLogProxy::findFirstUnreadIndex() {
|
||||||
auto listIndex = eventLogList->findFirstUnreadIndex();
|
auto listIndex = eventLogList->findFirstUnreadIndex();
|
||||||
if (listIndex != -1) {
|
if (listIndex != -1) {
|
||||||
listIndex = mapFromSource(eventLogList->index(listIndex, 0)).row();
|
listIndex = mapFromSource(eventLogList->index(listIndex, 0)).row();
|
||||||
if (mMaxDisplayItems <= listIndex) setMaxDisplayItems(listIndex + mDisplayItemsStep);
|
loadUntil(listIndex);
|
||||||
return listIndex;
|
return listIndex;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -5880,42 +5880,42 @@ Um sie in einem kommerziellen Projekt zu aktivieren, kontaktieren Sie uns bitte.
|
||||||
<context>
|
<context>
|
||||||
<name>SelectedChatView</name>
|
<name>SelectedChatView</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="48"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="49"/>
|
||||||
<source>chat_view_group_call_toast_message</source>
|
<source>chat_view_group_call_toast_message</source>
|
||||||
<translation>Gruppenanruf starten?</translation>
|
<translation>Gruppenanruf starten?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="144"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="145"/>
|
||||||
<source>unencrypted_conversation_warning</source>
|
<source>unencrypted_conversation_warning</source>
|
||||||
<extracomment>This conversation is not encrypted !</extracomment>
|
<extracomment>This conversation is not encrypted !</extracomment>
|
||||||
<translation>Dieser Chat ist nicht verschlüsselt!</translation>
|
<translation>Dieser Chat ist nicht verschlüsselt!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="430"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="433"/>
|
||||||
<source>reply_to_label</source>
|
<source>reply_to_label</source>
|
||||||
<extracomment>Reply to %1</extracomment>
|
<extracomment>Reply to %1</extracomment>
|
||||||
<translation>Auf %1 antworten</translation>
|
<translation>Auf %1 antworten</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="638"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="639"/>
|
||||||
<source>shared_medias_title</source>
|
<source>shared_medias_title</source>
|
||||||
<extracomment>Shared medias</extracomment>
|
<extracomment>Shared medias</extracomment>
|
||||||
<translation>Geteilte Medien</translation>
|
<translation>Geteilte Medien</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="640"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="641"/>
|
||||||
<source>shared_documents_title</source>
|
<source>shared_documents_title</source>
|
||||||
<extracomment>Shared documents</extracomment>
|
<extracomment>Shared documents</extracomment>
|
||||||
<translation>Geteilte Dokumente</translation>
|
<translation>Geteilte Dokumente</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="669"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="670"/>
|
||||||
<source>forward_to_title</source>
|
<source>forward_to_title</source>
|
||||||
<extracomment>Forward to…</extracomment>
|
<extracomment>Forward to…</extracomment>
|
||||||
<translation>Weiterleiten an…</translation>
|
<translation>Weiterleiten an…</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="703"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="704"/>
|
||||||
<source>conversations_title</source>
|
<source>conversations_title</source>
|
||||||
<extracomment>Conversations</extracomment>
|
<extracomment>Conversations</extracomment>
|
||||||
<translation>Chats</translation>
|
<translation>Chats</translation>
|
||||||
|
|
|
||||||
|
|
@ -5757,42 +5757,42 @@ To enable them in a commercial project, please contact us.</translation>
|
||||||
<context>
|
<context>
|
||||||
<name>SelectedChatView</name>
|
<name>SelectedChatView</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="48"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="49"/>
|
||||||
<source>chat_view_group_call_toast_message</source>
|
<source>chat_view_group_call_toast_message</source>
|
||||||
<translation>Start a group call ?</translation>
|
<translation>Start a group call ?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="144"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="145"/>
|
||||||
<source>unencrypted_conversation_warning</source>
|
<source>unencrypted_conversation_warning</source>
|
||||||
<extracomment>This conversation is not encrypted !</extracomment>
|
<extracomment>This conversation is not encrypted !</extracomment>
|
||||||
<translation>This conversation is not encrypted !</translation>
|
<translation>This conversation is not encrypted !</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="430"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="433"/>
|
||||||
<source>reply_to_label</source>
|
<source>reply_to_label</source>
|
||||||
<extracomment>Reply to %1</extracomment>
|
<extracomment>Reply to %1</extracomment>
|
||||||
<translation>Reply to %1</translation>
|
<translation>Reply to %1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="638"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="639"/>
|
||||||
<source>shared_medias_title</source>
|
<source>shared_medias_title</source>
|
||||||
<extracomment>Shared medias</extracomment>
|
<extracomment>Shared medias</extracomment>
|
||||||
<translation>Shared medias</translation>
|
<translation>Shared medias</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="640"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="641"/>
|
||||||
<source>shared_documents_title</source>
|
<source>shared_documents_title</source>
|
||||||
<extracomment>Shared documents</extracomment>
|
<extracomment>Shared documents</extracomment>
|
||||||
<translation>Shared documents</translation>
|
<translation>Shared documents</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="669"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="670"/>
|
||||||
<source>forward_to_title</source>
|
<source>forward_to_title</source>
|
||||||
<extracomment>Forward to…</extracomment>
|
<extracomment>Forward to…</extracomment>
|
||||||
<translation>Forward to…</translation>
|
<translation>Forward to…</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="703"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="704"/>
|
||||||
<source>conversations_title</source>
|
<source>conversations_title</source>
|
||||||
<extracomment>Conversations</extracomment>
|
<extracomment>Conversations</extracomment>
|
||||||
<translation>Conversations</translation>
|
<translation>Conversations</translation>
|
||||||
|
|
|
||||||
|
|
@ -5728,42 +5728,42 @@ Pour les activer dans un projet commercial, merci de nous contacter.</translatio
|
||||||
<context>
|
<context>
|
||||||
<name>SelectedChatView</name>
|
<name>SelectedChatView</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="48"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="49"/>
|
||||||
<source>chat_view_group_call_toast_message</source>
|
<source>chat_view_group_call_toast_message</source>
|
||||||
<translation>Démarrer un appel de groupe ?</translation>
|
<translation>Démarrer un appel de groupe ?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="144"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="145"/>
|
||||||
<source>unencrypted_conversation_warning</source>
|
<source>unencrypted_conversation_warning</source>
|
||||||
<extracomment>This conversation is not encrypted !</extracomment>
|
<extracomment>This conversation is not encrypted !</extracomment>
|
||||||
<translation>Cette conversation n'est pas chiffrée !</translation>
|
<translation>Cette conversation n'est pas chiffrée !</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="430"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="433"/>
|
||||||
<source>reply_to_label</source>
|
<source>reply_to_label</source>
|
||||||
<extracomment>Reply to %1</extracomment>
|
<extracomment>Reply to %1</extracomment>
|
||||||
<translation>Réponse à %1</translation>
|
<translation>Réponse à %1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="638"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="639"/>
|
||||||
<source>shared_medias_title</source>
|
<source>shared_medias_title</source>
|
||||||
<extracomment>Shared medias</extracomment>
|
<extracomment>Shared medias</extracomment>
|
||||||
<translation>Médias partagés</translation>
|
<translation>Médias partagés</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="640"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="641"/>
|
||||||
<source>shared_documents_title</source>
|
<source>shared_documents_title</source>
|
||||||
<extracomment>Shared documents</extracomment>
|
<extracomment>Shared documents</extracomment>
|
||||||
<translation>Documents partagés</translation>
|
<translation>Documents partagés</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="669"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="670"/>
|
||||||
<source>forward_to_title</source>
|
<source>forward_to_title</source>
|
||||||
<extracomment>Forward to…</extracomment>
|
<extracomment>Forward to…</extracomment>
|
||||||
<translation>Transférer à…</translation>
|
<translation>Transférer à…</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="703"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="704"/>
|
||||||
<source>conversations_title</source>
|
<source>conversations_title</source>
|
||||||
<extracomment>Conversations</extracomment>
|
<extracomment>Conversations</extracomment>
|
||||||
<translation>Conversations</translation>
|
<translation>Conversations</translation>
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,9 @@ TextEdit {
|
||||||
property string lastTextSelected : ''
|
property string lastTextSelected : ''
|
||||||
property string searchedTextPart
|
property string searchedTextPart
|
||||||
color: DefaultStyle.main2_700
|
color: DefaultStyle.main2_700
|
||||||
|
// force restoring cursor in case we click on a mention, otherwise
|
||||||
|
// the cursor stays IBeam
|
||||||
|
onVisibleChanged: if (!visible) UtilsCpp.restoreGlobalCursor()
|
||||||
font {
|
font {
|
||||||
pixelSize: (contentGui && UtilsCpp.isOnlyEmojis(contentGui.core.text)) ? Typography.h1.pixelSize : Typography.p1.pixelSize
|
pixelSize: (contentGui && UtilsCpp.isOnlyEmojis(contentGui.core.text)) ? Typography.h1.pixelSize : Typography.p1.pixelSize
|
||||||
weight: Typography.p1.weight
|
weight: Typography.p1.weight
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ ListView {
|
||||||
|
|
||||||
property ChatGui chatGui
|
property ChatGui chatGui
|
||||||
height: contentHeight
|
height: contentHeight
|
||||||
|
property int delegateHoverRectangleRadius: 0
|
||||||
|
|
||||||
signal participantClicked(string username)
|
signal participantClicked(string username)
|
||||||
|
|
||||||
|
|
@ -60,6 +61,7 @@ ListView {
|
||||||
visible: mousearea.containsMouse
|
visible: mousearea.containsMouse
|
||||||
color: DefaultStyle.main2_200
|
color: DefaultStyle.main2_200
|
||||||
opacity: 0.5
|
opacity: 0.5
|
||||||
|
radius: mainItem.delegateHoverRectangleRadius
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ FocusScope {
|
||||||
property CallGui call
|
property CallGui call
|
||||||
property alias callHeaderContent: splitPanel.header.contentItem
|
property alias callHeaderContent: splitPanel.header.contentItem
|
||||||
property bool replyingToMessage: false
|
property bool replyingToMessage: false
|
||||||
|
property string lastChar
|
||||||
enum PanelType { MessageReactions, SharedFiles, Medias, ImdnStatus, ForwardToList, ManageParticipants, EphemeralSettings, None}
|
enum PanelType { MessageReactions, SharedFiles, Medias, ImdnStatus, ForwardToList, ManageParticipants, EphemeralSettings, None}
|
||||||
|
|
||||||
signal oneOneCall(bool video)
|
signal oneOneCall(bool video)
|
||||||
|
|
@ -332,8 +333,9 @@ FocusScope {
|
||||||
Control.Control {
|
Control.Control {
|
||||||
id: participantListPopup
|
id: participantListPopup
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: visible ? Math.min(participantInfoList.height, Utils.getSizeWithScreenRatio(200)) : 0
|
height: Math.min(participantInfoList.height, Utils.getSizeWithScreenRatio(200))
|
||||||
visible: false
|
visible: mainItem.lastChar === "@"
|
||||||
|
onVisibleChanged: console.log("participant list visible changed", visible, height)
|
||||||
anchors.bottom: chatMessagesListView.bottom
|
anchors.bottom: chatMessagesListView.bottom
|
||||||
anchors.left: chatMessagesListView.left
|
anchors.left: chatMessagesListView.left
|
||||||
anchors.right: chatMessagesListView.right
|
anchors.right: chatMessagesListView.right
|
||||||
|
|
@ -371,6 +373,7 @@ FocusScope {
|
||||||
height: contentHeight
|
height: contentHeight
|
||||||
width: participantListPopup.width
|
width: participantListPopup.width
|
||||||
chatGui: mainItem.chat
|
chatGui: mainItem.chat
|
||||||
|
delegateHoverRectangleRadius: Utils.getSizeWithScreenRatio(20)
|
||||||
onParticipantClicked: (username) => {
|
onParticipantClicked: (username) => {
|
||||||
messageSender.text = messageSender.text + username + " "
|
messageSender.text = messageSender.text + username + " "
|
||||||
messageSender.textArea.cursorPosition = messageSender.text.length
|
messageSender.textArea.cursorPosition = messageSender.text.length
|
||||||
|
|
@ -509,9 +512,7 @@ FocusScope {
|
||||||
if (text !== "") {
|
if (text !== "") {
|
||||||
mainItem.chat.core.lCompose()
|
mainItem.chat.core.lCompose()
|
||||||
}
|
}
|
||||||
var lastChar = text.slice(-1)
|
mainItem.lastChar = text.slice(-1)
|
||||||
if (lastChar == "@") participantListPopup.visible = true
|
|
||||||
else participantListPopup.visible = false
|
|
||||||
mainItem.chat.core.sendingText = text
|
mainItem.chat.core.sendingText = text
|
||||||
}
|
}
|
||||||
onSendMessage: {
|
onSendMessage: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue