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:
@@ -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 ¶ms = SectionShow()) = 0;
|
||||
virtual void showBackFromStack(
|
||||
const SectionShow ¶ms = SectionShow()) = 0;
|
||||
virtual not_null<Controller*> parentController() = 0;
|
||||
|
||||
void showPeerInfo(
|
||||
PeerId peerId,
|
||||
const SectionShow ¶ms = SectionShow());
|
||||
void showPeerInfo(
|
||||
not_null<PeerData*> peer,
|
||||
const SectionShow ¶ms = SectionShow());
|
||||
void showPeerInfo(
|
||||
not_null<History*> history,
|
||||
const SectionShow ¶ms = SectionShow());
|
||||
|
||||
};
|
||||
|
||||
class Controller : public Navigation {
|
||||
public:
|
||||
Controller(not_null<MainWindow*> window) : _window(window) {
|
||||
}
|
||||
@@ -126,9 +154,9 @@ public:
|
||||
|
||||
void showSection(
|
||||
SectionMemento &&memento,
|
||||
const SectionShow ¶ms = SectionShow());
|
||||
const SectionShow ¶ms = SectionShow()) override;
|
||||
void showBackFromStack(
|
||||
const SectionShow ¶ms = SectionShow());
|
||||
const SectionShow ¶ms = SectionShow()) override;
|
||||
|
||||
void showPeerHistory(
|
||||
PeerId peerId,
|
||||
@@ -143,16 +171,6 @@ public:
|
||||
const SectionShow ¶ms = SectionShow::Way::ClearStack,
|
||||
MsgId msgId = ShowAtUnreadMsgId);
|
||||
|
||||
void showPeerInfo(
|
||||
PeerId peerId,
|
||||
const SectionShow ¶ms = SectionShow());
|
||||
void showPeerInfo(
|
||||
not_null<PeerData*> peer,
|
||||
const SectionShow ¶ms = SectionShow());
|
||||
void showPeerInfo(
|
||||
not_null<History*> history,
|
||||
const SectionShow ¶ms = SectionShow());
|
||||
|
||||
void clearSectionStack(
|
||||
const SectionShow ¶ms = 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;
|
||||
|
Reference in New Issue
Block a user