Move support to the main settings (support).

This commit is contained in:
John Preston 2018-10-07 14:42:09 +03:00
parent 1b4f3a7529
commit 6ba0755e15
4 changed files with 19 additions and 12 deletions

View File

@ -907,7 +907,6 @@ void SetupThemeOptions(not_null<Ui::VerticalLayout*> container) {
} }
void SetupSupport(not_null<Ui::VerticalLayout*> container) { void SetupSupport(not_null<Ui::VerticalLayout*> container) {
AddDivider(container);
AddSkip(container); AddSkip(container);
AddSubsectionTitle(container, rpl::single(qsl("Support settings"))); AddSubsectionTitle(container, rpl::single(qsl("Support settings")));
@ -986,9 +985,6 @@ void Chat::setupContent() {
SetupChatBackground(content); SetupChatBackground(content);
SetupStickersEmoji(content); SetupStickersEmoji(content);
SetupMessages(content); SetupMessages(content);
if (Auth().supportMode()) {
SetupSupport(content);
}
Ui::ResizeFitChild(this, content); Ui::ResizeFitChild(this, content);
} }

View File

@ -12,8 +12,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Settings { namespace Settings {
void SetupDataStorage(not_null<Ui::VerticalLayout*> container); void SetupDataStorage(not_null<Ui::VerticalLayout*> container);
void SetupUseDefaultTheme(not_null<Ui::VerticalLayout*> container);
void SetupDefaultThemes(not_null<Ui::VerticalLayout*> container); void SetupDefaultThemes(not_null<Ui::VerticalLayout*> container);
void SetupSupport(not_null<Ui::VerticalLayout*> container);
class Chat : public Section { class Chat : public Section {
public: public:

View File

@ -20,6 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/abstract_box.h" #include "boxes/abstract_box.h"
#include "lang/lang_keys.h" #include "lang/lang_keys.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "auth_session.h"
#include "styles/style_boxes.h" #include "styles/style_boxes.h"
#include "styles/style_settings.h" #include "styles/style_settings.h"
@ -177,9 +178,11 @@ void AddSubsectionTitle(
} }
void FillMenu(Fn<void(Type)> showOther, MenuCallback addAction) { void FillMenu(Fn<void(Type)> showOther, MenuCallback addAction) {
addAction( if (!Auth().supportMode()) {
lang(lng_settings_information), addAction(
[=] { showOther(Type::Information); }); lang(lng_settings_information),
[=] { showOther(Type::Information); });
}
addAction( addAction(
lang(lng_settings_logout), lang(lng_settings_logout),
[=] { App::wnd()->onLogout(); }); [=] { App::wnd()->onLogout(); });

View File

@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "settings/settings_common.h" #include "settings/settings_common.h"
#include "settings/settings_codes.h" #include "settings/settings_codes.h"
#include "settings/settings_chat.h"
#include "boxes/language_box.h" #include "boxes/language_box.h"
#include "boxes/confirm_box.h" #include "boxes/confirm_box.h"
#include "boxes/about_box.h" #include "boxes/about_box.h"
@ -63,10 +64,17 @@ void SetupSections(
icon icon
)->addClickHandler([=] { showOther(type); }); )->addClickHandler([=] { showOther(type); });
}; };
addSection( if (Auth().supportMode()) {
lng_settings_information, SetupSupport(container);
Type::Information,
&st::settingsIconInformation); AddDivider(container);
AddSkip(container);
} else {
addSection(
lng_settings_information,
Type::Information,
&st::settingsIconInformation);
}
addSection( addSection(
lng_settings_section_notify, lng_settings_section_notify,
Type::Notifications, Type::Notifications,