2021-05-26 23:16:12 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Window {
|
|
|
|
|
2021-05-27 13:54:24 +00:00
|
|
|
class Adaptive {
|
2021-05-26 23:16:12 +00:00
|
|
|
public:
|
|
|
|
enum class WindowLayout {
|
|
|
|
OneColumn,
|
|
|
|
Normal,
|
|
|
|
ThreeColumn,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class ChatLayout {
|
|
|
|
Normal,
|
|
|
|
Wide,
|
|
|
|
};
|
|
|
|
|
2021-05-27 13:54:24 +00:00
|
|
|
Adaptive();
|
2021-05-26 23:16:12 +00:00
|
|
|
|
|
|
|
void setWindowLayout(WindowLayout value);
|
|
|
|
void setChatLayout(ChatLayout value);
|
|
|
|
|
2021-06-24 05:33:52 +00:00
|
|
|
[[nodiscard]] rpl::producer<> value() const;
|
|
|
|
[[nodiscard]] rpl::producer<> changes() const;
|
2021-05-26 23:16:12 +00:00
|
|
|
[[nodiscard]] rpl::producer<bool> oneColumnValue() const;
|
2021-05-26 23:20:00 +00:00
|
|
|
[[nodiscard]] rpl::producer<ChatLayout> chatLayoutValue() const;
|
2021-05-26 23:16:12 +00:00
|
|
|
|
|
|
|
[[nodiscard]] bool isOneColumn() const;
|
|
|
|
[[nodiscard]] bool isNormal() const;
|
|
|
|
[[nodiscard]] bool isThreeColumn() const;
|
|
|
|
|
2021-05-27 00:44:12 +00:00
|
|
|
[[nodiscard]] rpl::producer<bool> chatWideValue() const;
|
|
|
|
[[nodiscard]] bool isChatWide() const;
|
|
|
|
|
2021-05-26 23:16:12 +00:00
|
|
|
private:
|
|
|
|
rpl::variable<ChatLayout> _chatLayout;
|
|
|
|
rpl::variable<WindowLayout> _layout;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Window
|