2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

First version of CalendarBox is done.

Also moved BackgroundBox::Inner declaration inside backgroundbox.cpp
This commit is contained in:
John Preston
2017-03-07 17:03:07 +03:00
parent 6d80471fc9
commit ae977044f6
13 changed files with 600 additions and 78 deletions

View File

@@ -62,6 +62,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "styles/style_boxes.h"
#include "mtproto/dc_options.h"
#include "core/file_utilities.h"
#include "boxes/calendarbox.h"
#include "auth_session.h"
#include "window/notifications_manager.h"
@@ -2758,6 +2759,24 @@ void MainWidget::dlgUpdated(PeerData *peer, MsgId msgId) {
}
}
void MainWidget::showJumpToDate(PeerData *peer) {
t_assert(peer != nullptr);
auto shown = ([peer] {
if (auto history = App::historyLoaded(peer)) {
if (history->scrollTopItem) {
return history->scrollTopItem->date.date();
} else if (!history->lastMsgDate.isNull()) {
return history->lastMsgDate.date();
}
}
return QDate::currentDate();
})();
auto highlighted = shown;
Ui::show(Box<CalendarBox>(shown, highlighted, [peer](QDate date) {
Ui::show(Box<InformBox>("not implemented " + langDayOfMonthFull(date)));
}));
}
void MainWidget::windowShown() {
_history->windowShown();
}