Translations adjustments, trigger history reload earlier

This commit is contained in:
Sebastian J. Wolf 2020-08-30 15:04:15 +02:00
parent d4954e0d7e
commit 0849fadadd
3 changed files with 15 additions and 15 deletions

View file

@ -278,17 +278,17 @@ Page {
function handleScrollPositionChanged() {
console.log("Current position: " + chatView.contentY);
tdLibWrapper.viewMessage(chatInformation.id, chatView.itemAt(chatView.contentX, ( chatView.contentY + chatView.height - Theme.horizontalPageMargin )).myMessage.id);
var indexAtCursor = chatView.indexAt(chatView.contentX, chatView.contentY);
// If the list is at the top or close to the top, the index jumps to the top of the new list
// Before we find a solution, we don't reload at the top... TODO ;)
if (indexAtCursor > 5 && indexAtCursor < 25) {
chatModel.triggerLoadMoreHistory();
}
}
onContentYChanged: {
chatViewLoadingTimer.stop();
chatViewLoadingTimer.start();
if (!chatPage.loading) {
if (chatView.indexAt(chatView.contentX, chatView.contentY) < 20) {
console.log("Trying to get older history items...");
chatModel.triggerLoadMoreHistory();
}
}
}
onMovementEnded: {

View file

@ -59,8 +59,8 @@ void ChatModel::initialize(const QVariantMap &chatInformation)
void ChatModel::triggerLoadMoreHistory()
{
qDebug() << "[ChatModel] Trigger loading older history...";
if (!this->inIncrementalUpdate) {
qDebug() << "[ChatModel] Trigger loading older history...";
this->inIncrementalUpdate = true;
this->tdLibWrapper->getChatHistory(this->chatId, this->messages.first().toMap().value("id").toLongLong());
}

View file

@ -170,15 +170,15 @@
</message>
<message>
<source>Waiting for network...</source>
<translation>Auf Netzwerk warten...</translation>
<translation>Warte auf Netzwerk...</translation>
</message>
<message>
<source>Connecting to network...</source>
<translation>Zum Netzwerk verbinden...</translation>
<translation>Verbinde zum Netzwerk...</translation>
</message>
<message>
<source>Connecting to proxy...</source>
<translation>Zum Proxy verbinden...</translation>
<translation>Verbinde zum Proxy...</translation>
</message>
<message>
<source>Connected</source>
@ -186,7 +186,7 @@
</message>
<message>
<source>Updating content...</source>
<translation>Inhalte aktualisieren...</translation>
<translation>Aktualisiere Inhalte...</translation>
</message>
<message>
<source>chat</source>
@ -281,19 +281,19 @@
</message>
<message>
<source>Waiting for network...</source>
<translation>Warten auf Netzwerk...</translation>
<translation>Warte auf Netzwerk...</translation>
</message>
<message>
<source>Connecting to network...</source>
<translation>Zum Netzwerk verbinden...</translation>
<translation>Verbinde zum Netzwerk...</translation>
</message>
<message>
<source>Connecting to proxy...</source>
<translation>Zum Proxy verbinden...</translation>
<translation>Verbinde zum Proxy...</translation>
</message>
<message>
<source>Updating content...</source>
<translation>Inhalte aktualisieren...</translation>
<translation>Aktualisiere Inhalte...</translation>
</message>
<message>
<source>Unknown</source>