2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-03 08:05:12 +00:00

Updated TDesktop sources to 3.2.5

This commit is contained in:
RadRussianRus
2021-12-07 09:25:44 +03:00
556 changed files with 18784 additions and 8391 deletions

View File

@@ -53,6 +53,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_chat.h"
#include "styles/style_info.h"
#include "styles/style_window.h"
#include "base/qt_adapters.h"
#include <QtCore/QMimeData>
@@ -207,7 +208,11 @@ Widget::Widget(
) | rpl::to_empty);
connect(_inner, SIGNAL(draggingScrollDelta(int)), this, SLOT(onDraggingScrollDelta(int)));
connect(_inner, SIGNAL(mustScrollTo(int,int)), _scroll, SLOT(scrollToY(int,int)));
connect(_inner, &InnerWidget::mustScrollTo, [=](int top, int bottom) {
if (_scroll) {
_scroll->scrollToY(top, bottom);
}
});
connect(_inner, SIGNAL(dialogMoved(int,int)), this, SLOT(onDialogMoved(int,int)));
connect(_inner, SIGNAL(searchMessages()), this, SLOT(onNeedSearchMessages()));
connect(_inner, SIGNAL(completeHashtag(QString)), this, SLOT(onCompleteHashtag(QString)));
@@ -236,8 +241,14 @@ Widget::Widget(
}
}, lifetime());
connect(_scroll, SIGNAL(geometryChanged()), _inner, SLOT(onParentGeometryChanged()));
connect(_scroll, SIGNAL(scrolled()), this, SLOT(onListScroll()));
_scroll->geometryChanged(
) | rpl::start_with_next(crl::guard(_inner, [=] {
_inner->onParentGeometryChanged();
}), lifetime());
_scroll->scrolls(
) | rpl::start_with_next([=] {
onListScroll();
}, lifetime());
session().data().chatsListChanges(
) | rpl::filter([=](Data::Folder *folder) {
@@ -1475,12 +1486,12 @@ void Widget::showSearchFrom() {
void Widget::onFilterCursorMoved(int from, int to) {
if (to < 0) to = _filter->cursorPosition();
QString t = _filter->getLastText();
QStringRef r;
QStringView r;
for (int start = to; start > 0;) {
--start;
if (t.size() <= start) break;
if (t.at(start) == '#') {
r = t.midRef(start, to - start);
r = base::StringViewMid(t, start, to - start);
break;
}
if (!t.at(start).isLetterOrNumber() && t.at(start) != '_') break;
@@ -1495,7 +1506,9 @@ void Widget::onCompleteHashtag(QString tag) {
--start;
if (t.size() <= start) break;
if (t.at(start) == '#') {
if (cur == start + 1 || t.midRef(start + 1, cur - start - 1) == tag.midRef(0, cur - start - 1)) {
if (cur == start + 1
|| base::StringViewMid(t, start + 1, cur - start - 1)
== base::StringViewMid(tag, 0, cur - start - 1)) {
for (; cur < t.size() && cur - start - 1 < tag.size(); ++cur) {
if (t.at(cur) != tag.at(cur - start - 1)) break;
}