2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-04 08:35:21 +00:00

Remove history_item and layout from pch.

Also move some code to separate modules.
Also create history item views by Window::Controller.
This commit is contained in:
John Preston
2018-01-11 22:33:26 +03:00
parent 4740d44159
commit bee474f6e9
78 changed files with 794 additions and 525 deletions

View File

@@ -9,7 +9,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/main_window.h"
#include "info/info_memento.h"
#include "history/view/history_view_element.h"
#include "history/view/history_view_message.h"
#include "history/view/history_view_service_message.h"
#include "history/history_item.h"
#include "mainwidget.h"
#include "mainwindow.h"
#include "styles/style_window.h"
@@ -403,4 +406,16 @@ not_null<MainWidget*> Controller::chats() const {
return App::wnd()->chatsWidget();
}
std::unique_ptr<HistoryView::Element> Controller::createMessageView(
not_null<HistoryMessage*> message,
HistoryView::Context context) {
return std::make_unique<HistoryView::Message>(message, context);
}
std::unique_ptr<HistoryView::Element> Controller::createMessageView(
not_null<HistoryService*> message,
HistoryView::Context context) {
return std::make_unique<HistoryView::Service>(message, context);
}
} // namespace Window