2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-03 16:15:13 +00:00

Enable jump to date in feed.

This commit is contained in:
John Preston
2018-02-22 00:17:36 +03:00
parent e17dcbb8eb
commit f066f3f139
8 changed files with 174 additions and 71 deletions

View File

@@ -128,11 +128,7 @@ DialogsWidget::DialogsWidget(QWidget *parent, not_null<Window::Controller*> cont
subscribe(Adaptive::Changed(), [this] { updateForwardBar(); });
_cancelSearch->setClickedCallback([this] { onCancelSearch(); });
_jumpToDate->entity()->setClickedCallback([this] {
if (const auto peer = _searchInChat.peer()) {
this->controller()->showJumpToDate(peer, QDate());
}
});
_jumpToDate->entity()->setClickedCallback([this] { showJumpToDate(); });
_chooseFromUser->entity()->setClickedCallback([this] { showSearchFrom(); });
_lockUnlock->setVisible(Global::LocalPasscode());
subscribe(Global::RefLocalPasscodeChanged(), [this] { updateLockUnlockVisibility(); });
@@ -1036,6 +1032,12 @@ void DialogsWidget::clearSearchCache() {
MTP::cancel(base::take(_searchRequest));
}
void DialogsWidget::showJumpToDate() {
if (_searchInChat) {
this->controller()->showJumpToDate(_searchInChat, QDate());
}
}
void DialogsWidget::showSearchFrom() {
if (const auto peer = _searchInChat.peer()) {
const auto chat = _searchInChat;