2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 23:55:12 +00:00

Start scrollable CalendarBox.

This commit is contained in:
John Preston
2021-11-11 15:44:12 +04:00
parent f13e28a9c5
commit be7cd51740
11 changed files with 288 additions and 229 deletions

View File

@@ -1209,18 +1209,16 @@ void SessionController::showJumpToDate(Dialogs::Key chat, QDate requestedDate) {
: !currentPeerDate.isNull()
? currentPeerDate
: QDate::currentDate();
const auto month = highlighted;
auto callback = [=](const QDate &date) {
session().api().jumpToDate(chat, date);
};
auto box = Box<Ui::CalendarBox>(
month,
highlighted,
std::move(callback));
box->setMinDate(minPeerDate(chat));
box->setMaxDate(maxPeerDate(chat));
box->setBeginningButton(true);
show(std::move(box));
show(Box<Ui::CalendarBox>(Ui::CalendarBoxArgs{
.month = highlighted,
.highlighted = highlighted,
.callback = [=](const QDate &date) {
session().api().jumpToDate(chat, date);
},
.minDate = minPeerDate(chat),
.maxDate = maxPeerDate(chat),
.hasBeginningButton = true,
}));
}
void SessionController::showPassportForm(const Passport::FormRequest &request) {