/* 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_experimental.h" #include "ui/boxes/confirm_box.h" #include "ui/wrap/vertical_layout.h" #include "ui/wrap/slide_wrap.h" #include "ui/widgets/buttons.h" #include "ui/widgets/labels.h" #include "ui/vertical_list.h" #include "ui/gl/gl_detection.h" #include "ui/chat/chat_style_radius.h" #include "base/options.h" #include "core/application.h" #include "core/launcher.h" #include "chat_helpers/tabbed_panel.h" #include "dialogs/dialogs_widget.h" #include "info/profile/info_profile_actions.h" #include "lang/lang_keys.h" #include "mainwindow.h" #include "media/player/media_player_instance.h" #include "webview/webview_embed.h" #include "window/main_window.h" #include "window/window_peer_menu.h" #include "window/window_session_controller.h" #include "window/window_controller.h" #include "window/notifications_manager.h" #include "storage/localimageloader.h" #include "data/data_document_resolver.h" #include "styles/style_settings.h" #include "styles/style_layers.h" namespace Settings { namespace { void AddOption( not_null window, not_null container, base::options::option &option, rpl::producer<> resetClicks) { auto &lifetime = container->lifetime(); const auto name = option.name().isEmpty() ? option.id() : option.name(); const auto toggles = lifetime.make_state>(); std::move( resetClicks ) | rpl::map_to( option.defaultValue() ) | rpl::start_to_stream(*toggles, lifetime); const auto button = container->add(object_ptr