2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Show third column only when explicitly requested.

This allows you to show info in layer from mention links.
This commit is contained in:
John Preston
2017-12-04 11:33:33 +04:00
parent 629c216a7f
commit e1c68892d4
23 changed files with 184 additions and 120 deletions

View File

@@ -28,6 +28,8 @@ class MainWidget;
namespace Window {
class LayerWidget;
class MainWindow;
class SectionMemento;
enum class GifPauseReason {
Any = 0,
@@ -64,17 +66,43 @@ struct SectionShow {
SectionShow withWay(Way newWay) const {
return SectionShow(newWay, animated, activation);
}
SectionShow withThirdColumn() const {
auto copy = *this;
copy.thirdColumn = true;
return copy;
}
Way way = Way::Forward;
anim::type animated = anim::type::normal;
anim::activation activation = anim::activation::normal;
bool thirdColumn = false;
};
class MainWindow;
class SectionMemento;
class Controller;
class Controller {
class Navigation {
public:
virtual void showSection(
SectionMemento &&memento,
const SectionShow &params = SectionShow()) = 0;
virtual void showBackFromStack(
const SectionShow &params = SectionShow()) = 0;
virtual not_null<Controller*> parentController() = 0;
void showPeerInfo(
PeerId peerId,
const SectionShow &params = SectionShow());
void showPeerInfo(
not_null<PeerData*> peer,
const SectionShow &params = SectionShow());
void showPeerInfo(
not_null<History*> history,
const SectionShow &params = SectionShow());
};
class Controller : public Navigation {
public:
Controller(not_null<MainWindow*> window) : _window(window) {
}
@@ -126,9 +154,9 @@ public:
void showSection(
SectionMemento &&memento,
const SectionShow &params = SectionShow());
const SectionShow &params = SectionShow()) override;
void showBackFromStack(
const SectionShow &params = SectionShow());
const SectionShow &params = SectionShow()) override;
void showPeerHistory(
PeerId peerId,
@@ -143,16 +171,6 @@ public:
const SectionShow &params = SectionShow::Way::ClearStack,
MsgId msgId = ShowAtUnreadMsgId);
void showPeerInfo(
PeerId peerId,
const SectionShow &params = SectionShow());
void showPeerInfo(
not_null<PeerData*> peer,
const SectionShow &params = SectionShow());
void showPeerInfo(
not_null<History*> history,
const SectionShow &params = SectionShow());
void clearSectionStack(
const SectionShow &params = SectionShow::Way::ClearStack) {
showPeerHistory(
@@ -186,6 +204,10 @@ public:
return _dialogsListDisplayForced;
}
not_null<Controller*> parentController() override {
return this;
}
private:
int minimalThreeColumnWidth() const;
not_null<MainWidget*> chats() const;