mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Add hide-chats-list-in-forums setting.
This commit is contained in:
parent
98ab91a56a
commit
b17b806d91
3 changed files with 15 additions and 1 deletions
|
@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
*/
|
*/
|
||||||
#include "dialogs/dialogs_widget.h"
|
#include "dialogs/dialogs_widget.h"
|
||||||
|
|
||||||
|
#include "base/options.h"
|
||||||
#include "dialogs/ui/dialogs_stories_content.h"
|
#include "dialogs/ui/dialogs_stories_content.h"
|
||||||
#include "dialogs/ui/dialogs_stories_list.h"
|
#include "dialogs/ui/dialogs_stories_list.h"
|
||||||
#include "dialogs/dialogs_inner_widget.h"
|
#include "dialogs/dialogs_inner_widget.h"
|
||||||
|
@ -86,8 +87,16 @@ namespace {
|
||||||
constexpr auto kSearchPerPage = 50;
|
constexpr auto kSearchPerPage = 50;
|
||||||
constexpr auto kStoriesExpandDuration = crl::time(200);
|
constexpr auto kStoriesExpandDuration = crl::time(200);
|
||||||
|
|
||||||
|
base::options::toggle OptionForumHideChatsList({
|
||||||
|
.id = kOptionForumHideChatsList,
|
||||||
|
.name = "Hide chats list in forums",
|
||||||
|
.description = "Don't keep a narrow column of chats list.",
|
||||||
|
});
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
const char kOptionForumHideChatsList[] = "forum-hide-chats-list";
|
||||||
|
|
||||||
class Widget::BottomButton : public Ui::RippleButton {
|
class Widget::BottomButton : public Ui::RippleButton {
|
||||||
public:
|
public:
|
||||||
BottomButton(
|
BottomButton(
|
||||||
|
@ -2401,7 +2410,8 @@ void Widget::showForum(
|
||||||
const Window::SectionShow ¶ms) {
|
const Window::SectionShow ¶ms) {
|
||||||
if (!params.childColumn
|
if (!params.childColumn
|
||||||
|| !Core::App().settings().dialogsWidthRatio()
|
|| !Core::App().settings().dialogsWidthRatio()
|
||||||
|| (_layout != Layout::Main)) {
|
|| (_layout != Layout::Main)
|
||||||
|
|| OptionForumHideChatsList.value()) {
|
||||||
changeOpenedForum(forum, params.animated);
|
changeOpenedForum(forum, params.animated);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,6 +65,8 @@ struct Content;
|
||||||
|
|
||||||
namespace Dialogs {
|
namespace Dialogs {
|
||||||
|
|
||||||
|
extern const char kOptionForumHideChatsList[];
|
||||||
|
|
||||||
struct RowDescriptor;
|
struct RowDescriptor;
|
||||||
class Row;
|
class Row;
|
||||||
class FakeRow;
|
class FakeRow;
|
||||||
|
|
|
@ -18,6 +18,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
#include "core/launcher.h"
|
#include "core/launcher.h"
|
||||||
#include "chat_helpers/tabbed_panel.h"
|
#include "chat_helpers/tabbed_panel.h"
|
||||||
|
#include "dialogs/dialogs_widget.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "media/player/media_player_instance.h"
|
#include "media/player/media_player_instance.h"
|
||||||
|
@ -137,6 +138,7 @@ void SetupExperimental(
|
||||||
};
|
};
|
||||||
|
|
||||||
addToggle(ChatHelpers::kOptionTabbedPanelShowOnClick);
|
addToggle(ChatHelpers::kOptionTabbedPanelShowOnClick);
|
||||||
|
addToggle(Dialogs::kOptionForumHideChatsList);
|
||||||
addToggle(Core::kOptionFractionalScalingEnabled);
|
addToggle(Core::kOptionFractionalScalingEnabled);
|
||||||
addToggle(Window::kOptionViewProfileInChatsListContextMenu);
|
addToggle(Window::kOptionViewProfileInChatsListContextMenu);
|
||||||
addToggle(Ui::GL::kOptionAllowLinuxNvidiaOpenGL);
|
addToggle(Ui::GL::kOptionAllowLinuxNvidiaOpenGL);
|
||||||
|
|
Loading…
Add table
Reference in a new issue