2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 23:15:59 +00:00

Improve support shortcuts handling.

This commit is contained in:
John Preston
2018-12-29 17:09:45 +04:00
parent 219b824338
commit 496d711684
6 changed files with 84 additions and 24 deletions

View File

@@ -226,6 +226,10 @@ DialogsWidget::DialogsWidget(QWidget *parent, not_null<Window::Controller*> cont
loadDialogs();
}
});
_inner->listBottomReached(
) | rpl::start_with_next([=] {
loadMoreBlockedByDateChats();
}, lifetime());
_filter->setFocusPolicy(Qt::StrongFocus);
_filter->customUpDown(true);
@@ -530,14 +534,7 @@ void DialogsWidget::refreshLoadMoreButton() {
st::dialogsLoadMore,
st::dialogsLoadMore);
_loadMoreChats->addClickHandler([=] {
if (_loadMoreChats->isDisabled()) {
return;
}
const auto max = Auth().settings().supportChatsTimeSlice();
_dialogsLoadTill = _dialogsOffsetDate
? (_dialogsOffsetDate - max)
: (unixtime() - max);
loadDialogs();
loadMoreBlockedByDateChats();
});
updateControlsGeometry();
}
@@ -546,6 +543,17 @@ void DialogsWidget::refreshLoadMoreButton() {
_loadMoreChats->setText(loading ? "Loading..." : "Load more");
}
void DialogsWidget::loadMoreBlockedByDateChats() {
if (!_loadMoreChats || _loadMoreChats->isDisabled()) {
return;
}
const auto max = Auth().settings().supportChatsTimeSlice();
_dialogsLoadTill = _dialogsOffsetDate
? (_dialogsOffsetDate - max)
: (unixtime() - max);
loadDialogs();
}
void DialogsWidget::pinnedDialogsReceived(
const MTPmessages_PeerDialogs &result,
mtpRequestId requestId) {