2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +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

@@ -20,6 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_window.h"
#include "storage/file_download.h"
#include "auth_session.h"
#include "history/history_item.h"
#include "platform/platform_specific.h"
namespace Window {
@@ -63,6 +64,16 @@ Manager::Manager(System *system) : Notifications::Manager(system) {
_inputCheckTimer.setTimeoutHandler([this] { checkLastInput(); });
}
Manager::QueuedNotification::QueuedNotification(
not_null<HistoryItem*> item
, int forwardedCount)
: history(item->history())
, peer(history->peer)
, author((!peer->isUser() && !item->isPost()) ? item->author() : nullptr)
, item((forwardedCount < 2) ? item.get() : nullptr)
, forwardedCount(forwardedCount) {
}
QPixmap Manager::hiddenUserpicPlaceholder() const {
if (_hiddenUserpicPlaceholder.isNull()) {
_hiddenUserpicPlaceholder = App::pixmapFromImageInPlace(Messenger::Instance().logoNoMargin().scaled(st::notifyPhotoSize, st::notifyPhotoSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));