/* 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 */ #include "settings/settings_common.h" #include "settings/settings_chat.h" #include "settings/settings_advanced.h" #include "settings/settings_information.h" #include "settings/settings_main.h" #include "settings/settings_notifications.h" #include "settings/settings_privacy_security.h" #include "ui/wrap/padding_wrap.h" #include "ui/wrap/vertical_layout.h" #include "ui/widgets/labels.h" #include "info/profile/info_profile_button.h" #include "boxes/abstract_box.h" #include "lang/lang_keys.h" #include "mainwindow.h" #include "styles/style_boxes.h" #include "styles/style_settings.h" namespace Settings { object_ptr
CreateSection( Type type, not_null parent, Window::Controller *controller, UserData *self) { switch (type) { case Type::Main: return object_ptr
(parent, controller, self); case Type::Information: return object_ptr(parent, controller, self); case Type::Notifications: return object_ptr(parent, self); case Type::PrivacySecurity: return object_ptr(parent, self); case Type::Advanced: return object_ptr(parent, self); case Type::Chat: return object_ptr(parent, self); } Unexpected("Settings section type in Widget::createInnerWidget."); } void AddSkip(not_null container) { AddSkip(container, st::settingsSectionSkip); } void AddSkip(not_null container, int skip) { container->add(object_ptr( container, skip)); } void AddDivider(not_null container) { container->add(object_ptr(container)); } void AddDividerText( not_null container, rpl::producer text) { container->add(object_ptr( container, object_ptr( container, std::move(text), st::boxDividerLabel), st::settingsDividerLabelPadding)); } not_null AddButton( not_null container, LangKey text, const style::InfoProfileButton &st, const style::icon *leftIcon) { return AddButton(container, Lang::Viewer(text), st, leftIcon); } not_null AddButton( not_null container, rpl::producer text, const style::InfoProfileButton &st, const style::icon *leftIcon) { const auto result = container->add(object_ptr