2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Return third section when returning in main section.

This commit is contained in:
John Preston
2017-10-03 19:13:36 +01:00
parent 76b8078bd9
commit c0bb8a8af7
2 changed files with 136 additions and 82 deletions

View File

@@ -74,65 +74,7 @@ class HistoryWidget;
class OverviewWidget;
class HistoryHider;
enum StackItemType {
HistoryStackItem,
SectionStackItem,
OverviewStackItem,
};
class StackItem {
public:
StackItem(PeerData *peer) : peer(peer) {
}
virtual StackItemType type() const = 0;
virtual ~StackItem() {
}
PeerData *peer;
};
class StackItemHistory : public StackItem {
public:
StackItemHistory(PeerData *peer, MsgId msgId, QList<MsgId> replyReturns) : StackItem(peer)
, msgId(msgId)
, replyReturns(replyReturns) {
}
StackItemType type() const {
return HistoryStackItem;
}
MsgId msgId;
QList<MsgId> replyReturns;
};
class StackItemSection : public StackItem {
public:
StackItemSection(std::unique_ptr<Window::SectionMemento> &&memento);
~StackItemSection();
StackItemType type() const {
return SectionStackItem;
}
Window::SectionMemento *memento() const {
return _memento.get();
}
private:
std::unique_ptr<Window::SectionMemento> _memento;
};
class StackItemOverview : public StackItem {
public:
StackItemOverview(PeerData *peer, MediaOverviewType mediaType, int32 lastWidth, int32 lastScrollTop) : StackItem(peer)
, mediaType(mediaType)
, lastWidth(lastWidth)
, lastScrollTop(lastScrollTop) {
}
StackItemType type() const {
return OverviewStackItem;
}
MediaOverviewType mediaType;
int32 lastWidth, lastScrollTop;
};
class StackItem;
enum SilentNotifiesStatus {
SilentNotifiesDontChange,