Some settings reordered in sections.
This commit is contained in:
		
							parent
							
								
									97a4c76043
								
							
						
					
					
						commit
						130aa67ba0
					
				
					 10 changed files with 163 additions and 187 deletions
				
			
		| 
						 | 
					@ -354,8 +354,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 | 
				
			||||||
"lng_settings_peer_to_peer_about" = "Disabling peer-to-peer will relay all calls through Telegram servers to avoid revealing your IP address, but may slightly decrease audio quality.";
 | 
					"lng_settings_peer_to_peer_about" = "Disabling peer-to-peer will relay all calls through Telegram servers to avoid revealing your IP address, but may slightly decrease audio quality.";
 | 
				
			||||||
"lng_settings_advanced" = "Advanced";
 | 
					"lng_settings_advanced" = "Advanced";
 | 
				
			||||||
"lng_settings_stickers_emoji" = "Stickers and emoji";
 | 
					"lng_settings_stickers_emoji" = "Stickers and emoji";
 | 
				
			||||||
 | 
					"lng_settings_messages" = "Messages";
 | 
				
			||||||
"lng_settings_themes" = "Themes";
 | 
					"lng_settings_themes" = "Themes";
 | 
				
			||||||
"lng_settings_chat_other" = "Other";
 | 
					"lng_settings_data_storage" = "Data and storage";
 | 
				
			||||||
"lng_settings_information" = "Edit profile";
 | 
					"lng_settings_information" = "Edit profile";
 | 
				
			||||||
"lng_settings_passcode_title" = "Local passcode";
 | 
					"lng_settings_passcode_title" = "Local passcode";
 | 
				
			||||||
"lng_settings_password_title" = "Two-step verification";
 | 
					"lng_settings_password_title" = "Two-step verification";
 | 
				
			||||||
| 
						 | 
					@ -369,10 +370,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 | 
				
			||||||
"lng_theme_keep_changes" = "Keep changes";
 | 
					"lng_theme_keep_changes" = "Keep changes";
 | 
				
			||||||
"lng_theme_revert" = "Revert";
 | 
					"lng_theme_revert" = "Revert";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
"lng_download_path_dont_ask" = "Don't ask download path for each file";
 | 
					"lng_download_path_ask" = "Ask download path for each file";
 | 
				
			||||||
"lng_download_path_label" = "Download path:";
 | 
					"lng_download_path" = "Download path";
 | 
				
			||||||
"lng_download_path_temp" = "temp folder";
 | 
					"lng_download_path_temp" = "Temp folder";
 | 
				
			||||||
"lng_download_path_default" = "default folder";
 | 
					"lng_download_path_default" = "Default folder";
 | 
				
			||||||
"lng_download_path_clear" = "Clear all";
 | 
					"lng_download_path_clear" = "Clear all";
 | 
				
			||||||
"lng_download_path_header" = "Choose download path";
 | 
					"lng_download_path_header" = "Choose download path";
 | 
				
			||||||
"lng_download_path_default_radio" = "Telegram folder in system «Downloads»";
 | 
					"lng_download_path_default_radio" = "Telegram folder in system «Downloads»";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -14,13 +14,7 @@ settingsSectionButton: InfoProfileButton(infoProfileButton) {
 | 
				
			||||||
	font: boxTextFont;
 | 
						font: boxTextFont;
 | 
				
			||||||
	padding: margins(79px, 13px, 22px, 11px);
 | 
						padding: margins(79px, 13px, 22px, 11px);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
settingsGeneralButton: InfoProfileButton(settingsSectionButton) {
 | 
					 | 
				
			||||||
	padding: margins(24px, 13px, 22px, 11px);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
settingsButton: InfoProfileButton(settingsSectionButton) {
 | 
					settingsButton: InfoProfileButton(settingsSectionButton) {
 | 
				
			||||||
	padding: margins(22px, 13px, 22px, 11px);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
settingsPrivacyButton: InfoProfileButton(settingsButton) {
 | 
					 | 
				
			||||||
	padding: margins(22px, 10px, 22px, 8px);
 | 
						padding: margins(22px, 10px, 22px, 8px);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
settingsSectionSkip: 9px;
 | 
					settingsSectionSkip: 9px;
 | 
				
			||||||
| 
						 | 
					@ -30,24 +24,25 @@ settingsButtonRightSkip: 28px;
 | 
				
			||||||
settingsButtonRight: FlatLabel(defaultFlatLabel) {
 | 
					settingsButtonRight: FlatLabel(defaultFlatLabel) {
 | 
				
			||||||
	textFg: windowActiveTextFg;
 | 
						textFg: windowActiveTextFg;
 | 
				
			||||||
	style: boxTextStyle;
 | 
						style: boxTextStyle;
 | 
				
			||||||
 | 
						maxHeight: 20px;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
settingsScalePadding: margins(79px, 10px, 28px, 8px);
 | 
					settingsScalePadding: margins(79px, 10px, 28px, 8px);
 | 
				
			||||||
settingsBigScalePadding: margins(24px, 10px, 24px, 8px);
 | 
					settingsBigScalePadding: margins(22px, 10px, 22px, 8px);
 | 
				
			||||||
settingsSlider: SettingsSlider(defaultSettingsSlider) {
 | 
					settingsSlider: SettingsSlider(defaultSettingsSlider) {
 | 
				
			||||||
	barFg: windowBgOver;
 | 
						barFg: windowBgOver;
 | 
				
			||||||
	labelFg: windowSubTextFg;
 | 
						labelFg: windowSubTextFg;
 | 
				
			||||||
	labelFgActive: windowActiveTextFg;
 | 
						labelFgActive: windowActiveTextFg;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
settingsUpdateToggle: InfoProfileButton(settingsGeneralButton) {
 | 
					settingsUpdateToggle: InfoProfileButton(settingsButton) {
 | 
				
			||||||
	height: 40px;
 | 
						height: 40px;
 | 
				
			||||||
	padding: margins(24px, 8px, 22px, 8px);
 | 
						padding: margins(22px, 8px, 22px, 8px);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
settingsUpdateState: FlatLabel(defaultFlatLabel) {
 | 
					settingsUpdateState: FlatLabel(defaultFlatLabel) {
 | 
				
			||||||
	textFg: windowSubTextFg;
 | 
						textFg: windowSubTextFg;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
settingsUpdate: InfoProfileButton(infoMainButton, settingsButton) {
 | 
					settingsUpdate: InfoProfileButton(infoMainButton, settingsButton) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
settingsUpdateStatePosition: point(24px, 29px);
 | 
					settingsUpdateStatePosition: point(22px, 29px);
 | 
				
			||||||
settingsDividerLabelPadding: margins(22px, 10px, 22px, 19px);
 | 
					settingsDividerLabelPadding: margins(22px, 10px, 22px, 19px);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
settingsIconInformation: icon {{ "settings_information", menuIconFg }};
 | 
					settingsIconInformation: icon {{ "settings_information", menuIconFg }};
 | 
				
			||||||
| 
						 | 
					@ -75,9 +70,6 @@ settingsSendType: settingsCheckbox;
 | 
				
			||||||
settingsSendTypePadding: margins(22px, 5px, 10px, 5px);
 | 
					settingsSendTypePadding: margins(22px, 5px, 10px, 5px);
 | 
				
			||||||
settingsSendTypeSkip: 5px;
 | 
					settingsSendTypeSkip: 5px;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
settingsAskPathPadding: margins(22px, 10px, 10px, 0px);
 | 
					 | 
				
			||||||
settingsDownloadPathPadding: margins(22px, 1px, 10px, 0px);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
settingsBackgroundThumb: 76px;
 | 
					settingsBackgroundThumb: 76px;
 | 
				
			||||||
settingsThumbSkip: 16px;
 | 
					settingsThumbSkip: 16px;
 | 
				
			||||||
settingsSubsectionTitle: FlatLabel(defaultFlatLabel) {
 | 
					settingsSubsectionTitle: FlatLabel(defaultFlatLabel) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 | 
				
			||||||
#include "boxes/stickers_box.h"
 | 
					#include "boxes/stickers_box.h"
 | 
				
			||||||
#include "boxes/background_box.h"
 | 
					#include "boxes/background_box.h"
 | 
				
			||||||
#include "boxes/download_path_box.h"
 | 
					#include "boxes/download_path_box.h"
 | 
				
			||||||
 | 
					#include "boxes/local_storage_box.h"
 | 
				
			||||||
#include "ui/wrap/vertical_layout.h"
 | 
					#include "ui/wrap/vertical_layout.h"
 | 
				
			||||||
#include "ui/wrap/slide_wrap.h"
 | 
					#include "ui/wrap/slide_wrap.h"
 | 
				
			||||||
#include "ui/widgets/checkbox.h"
 | 
					#include "ui/widgets/checkbox.h"
 | 
				
			||||||
| 
						 | 
					@ -23,8 +24,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 | 
				
			||||||
#include "info/profile/info_profile_button.h"
 | 
					#include "info/profile/info_profile_button.h"
 | 
				
			||||||
#include "storage/localstorage.h"
 | 
					#include "storage/localstorage.h"
 | 
				
			||||||
#include "core/file_utilities.h"
 | 
					#include "core/file_utilities.h"
 | 
				
			||||||
 | 
					#include "data/data_session.h"
 | 
				
			||||||
 | 
					#include "auth_session.h"
 | 
				
			||||||
#include "mainwidget.h"
 | 
					#include "mainwidget.h"
 | 
				
			||||||
#include "styles/style_settings.h"
 | 
					#include "styles/style_settings.h"
 | 
				
			||||||
 | 
					#include "styles/style_boxes.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Settings {
 | 
					namespace Settings {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -55,17 +59,6 @@ private:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef OS_WIN_STORE
 | 
					 | 
				
			||||||
class DownloadPathRow : public Ui::RpWidget {
 | 
					 | 
				
			||||||
public:
 | 
					 | 
				
			||||||
	DownloadPathRow(QWidget *parent);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
private:
 | 
					 | 
				
			||||||
	void setupControls();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
#endif // OS_WIN_STORE
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void ChooseFromFile(not_null<QWidget*> parent);
 | 
					void ChooseFromFile(not_null<QWidget*> parent);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
BackgroundRow::BackgroundRow(QWidget *parent) : RpWidget(parent)
 | 
					BackgroundRow::BackgroundRow(QWidget *parent) : RpWidget(parent)
 | 
				
			||||||
| 
						 | 
					@ -315,8 +308,6 @@ void ChooseFromFile(not_null<QWidget*> parent) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef OS_WIN_STORE
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
QString DownloadPathText() {
 | 
					QString DownloadPathText() {
 | 
				
			||||||
	if (Global::DownloadPath().isEmpty()) {
 | 
						if (Global::DownloadPath().isEmpty()) {
 | 
				
			||||||
		return lang(lng_download_path_default);
 | 
							return lang(lng_download_path_default);
 | 
				
			||||||
| 
						 | 
					@ -326,49 +317,6 @@ QString DownloadPathText() {
 | 
				
			||||||
	return QDir::toNativeSeparators(Global::DownloadPath());
 | 
						return QDir::toNativeSeparators(Global::DownloadPath());
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DownloadPathRow::DownloadPathRow(QWidget *parent) : RpWidget(parent) {
 | 
					 | 
				
			||||||
	setupControls();
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void DownloadPathRow::setupControls() {
 | 
					 | 
				
			||||||
	const auto label = Ui::CreateChild<Ui::FlatLabel>(
 | 
					 | 
				
			||||||
		this,
 | 
					 | 
				
			||||||
		Lang::Viewer(lng_download_path_label),
 | 
					 | 
				
			||||||
		st::settingsLinkLabel);
 | 
					 | 
				
			||||||
	const auto link = Ui::CreateChild<Ui::LinkButton>(
 | 
					 | 
				
			||||||
		this,
 | 
					 | 
				
			||||||
		DownloadPathText(),
 | 
					 | 
				
			||||||
		st::settingsLink);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	base::ObservableViewer(
 | 
					 | 
				
			||||||
		Global::RefDownloadPathChanged()
 | 
					 | 
				
			||||||
	) | rpl::map([] {
 | 
					 | 
				
			||||||
		return DownloadPathText();
 | 
					 | 
				
			||||||
	}) | rpl::start_with_next([=](const QString &text) {
 | 
					 | 
				
			||||||
		link->setText(text);
 | 
					 | 
				
			||||||
	}, link->lifetime());
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	link->addClickHandler([] {
 | 
					 | 
				
			||||||
		Ui::show(Box<DownloadPathBox>());
 | 
					 | 
				
			||||||
	});
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	rpl::combine(
 | 
					 | 
				
			||||||
		widthValue(),
 | 
					 | 
				
			||||||
		label->sizeValue(),
 | 
					 | 
				
			||||||
		link->widthValue()
 | 
					 | 
				
			||||||
	) | rpl::start_with_next([=](int width, QSize labelSize, int possible) {
 | 
					 | 
				
			||||||
		const auto space = st::settingsLinkLabel.style.font->spacew;
 | 
					 | 
				
			||||||
		link->resizeToNaturalWidth(width - labelSize.width() - space);
 | 
					 | 
				
			||||||
		if (link->width() == possible) {
 | 
					 | 
				
			||||||
			label->moveToLeft(0, 0);
 | 
					 | 
				
			||||||
			link->moveToLeft(labelSize.width() + space, 0);
 | 
					 | 
				
			||||||
			resize(width, labelSize.height());
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}, link->lifetime());
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif // OS_WIN_STORE
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void SetupStickersEmoji(not_null<Ui::VerticalLayout*> container) {
 | 
					void SetupStickersEmoji(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
	AddSkip(container, st::settingsStickersEmojiPadding);
 | 
						AddSkip(container, st::settingsStickersEmojiPadding);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -434,11 +382,11 @@ void SetupStickersEmoji(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
	AddSkip(container, st::settingsCheckboxesSkip);
 | 
						AddSkip(container, st::settingsCheckboxesSkip);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void SetupChatOther(not_null<Ui::VerticalLayout*> container) {
 | 
					void SetupMessages(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
	AddDivider(container);
 | 
						AddDivider(container);
 | 
				
			||||||
	AddSkip(container, st::settingsSectionSkip);
 | 
						AddSkip(container, st::settingsSectionSkip);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	AddSubsectionTitle(container, lng_settings_chat_other);
 | 
						AddSubsectionTitle(container, lng_settings_messages);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	AddSkip(container, st::settingsSendTypeSkip);
 | 
						AddSkip(container, st::settingsSendTypeSkip);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -492,50 +440,91 @@ void SetupChatOther(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	AddSkip(inner, st::settingsCheckboxesSkip);
 | 
						AddSkip(inner, st::settingsCheckboxesSkip);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const auto dontask = inner->add(
 | 
					void SetupExport(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
 | 
						AddButton(
 | 
				
			||||||
 | 
							container,
 | 
				
			||||||
 | 
							lng_settings_export_data,
 | 
				
			||||||
 | 
							st::settingsButton
 | 
				
			||||||
 | 
						)->addClickHandler([] {
 | 
				
			||||||
 | 
							Ui::hideSettingsAndLayer();
 | 
				
			||||||
 | 
							App::CallDelayed(
 | 
				
			||||||
 | 
								st::boxDuration,
 | 
				
			||||||
 | 
								&Auth(),
 | 
				
			||||||
 | 
								[] { Auth().data().startExport(); });
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void SetupLocalStorage(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
 | 
						AddButton(
 | 
				
			||||||
 | 
							container,
 | 
				
			||||||
 | 
							lng_settings_local_storage,
 | 
				
			||||||
 | 
							st::settingsButton
 | 
				
			||||||
 | 
						)->addClickHandler([] {
 | 
				
			||||||
 | 
							LocalStorageBox::Show(&Auth().data().cache());
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void SetupDataStorage(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
 | 
						AddDivider(container);
 | 
				
			||||||
 | 
						AddSkip(container, st::settingsSectionSkip);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						AddSubsectionTitle(container, lng_settings_data_storage);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						auto wrap = object_ptr<Ui::VerticalLayout>(container);
 | 
				
			||||||
 | 
						const auto inner = wrap.data();
 | 
				
			||||||
 | 
						container->add(object_ptr<Ui::OverrideMargins>(
 | 
				
			||||||
 | 
							container,
 | 
				
			||||||
 | 
							std::move(wrap),
 | 
				
			||||||
 | 
							QMargins(0, 0, 0, st::settingsCheckbox.margin.bottom())));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						const auto ask = inner->add(
 | 
				
			||||||
		object_ptr<Ui::Checkbox>(
 | 
							object_ptr<Ui::Checkbox>(
 | 
				
			||||||
			inner,
 | 
								inner,
 | 
				
			||||||
			lang(lng_download_path_dont_ask),
 | 
								lang(lng_download_path_ask),
 | 
				
			||||||
			!Global::AskDownloadPath(),
 | 
								Global::AskDownloadPath(),
 | 
				
			||||||
			st::settingsCheckbox),
 | 
								st::settingsCheckbox),
 | 
				
			||||||
#ifndef OS_WIN_STORE
 | 
					 | 
				
			||||||
		st::settingsAskPathPadding);
 | 
					 | 
				
			||||||
#else // OS_WIN_STORE
 | 
					 | 
				
			||||||
		st::settingsCheckboxPadding);
 | 
							st::settingsCheckboxPadding);
 | 
				
			||||||
#endif // OS_WIN_STORE
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef OS_WIN_STORE
 | 
					#ifndef OS_WIN_STORE
 | 
				
			||||||
	const auto showpath = Ui::AttachAsChild(
 | 
						const auto showpath = Ui::AttachAsChild(
 | 
				
			||||||
		dontask,
 | 
							ask,
 | 
				
			||||||
		rpl::event_stream<bool>());
 | 
							rpl::event_stream<bool>());
 | 
				
			||||||
	const auto padding = st::settingsDownloadPathPadding;
 | 
					 | 
				
			||||||
	const auto path = container->add(
 | 
						const auto path = container->add(
 | 
				
			||||||
		object_ptr<Ui::SlideWrap<DownloadPathRow>>(
 | 
							object_ptr<Ui::SlideWrap<Button>>(
 | 
				
			||||||
			container,
 | 
								container,
 | 
				
			||||||
			object_ptr<DownloadPathRow>(container),
 | 
								object_ptr<Button>(
 | 
				
			||||||
			QMargins(
 | 
									container,
 | 
				
			||||||
			(padding.left()
 | 
									Lang::Viewer(lng_download_path),
 | 
				
			||||||
				+ st::settingsCheckbox.checkPosition.x()
 | 
									st::settingsButton)));
 | 
				
			||||||
				+ st::defaultCheck.diameter
 | 
						auto pathtext = rpl::single(
 | 
				
			||||||
				+ st::settingsCheckbox.textPosition.x()
 | 
							rpl::empty_value()
 | 
				
			||||||
				- st::settingsCheckbox.margin.left()),
 | 
						) | rpl::then(base::ObservableViewer(
 | 
				
			||||||
				padding.top(),
 | 
							Global::RefDownloadPathChanged()
 | 
				
			||||||
				padding.right(),
 | 
						)) | rpl::map([] {
 | 
				
			||||||
				padding.bottom())));
 | 
							return DownloadPathText();
 | 
				
			||||||
	AddSkip(container, st::settingsCheckboxPadding.bottom());
 | 
						});
 | 
				
			||||||
 | 
						CreateRightLabel(
 | 
				
			||||||
 | 
							path->entity(),
 | 
				
			||||||
 | 
							std::move(pathtext),
 | 
				
			||||||
 | 
							st::settingsButton,
 | 
				
			||||||
 | 
							lng_download_path);
 | 
				
			||||||
 | 
						path->entity()->addClickHandler([] {
 | 
				
			||||||
 | 
							Ui::show(Box<DownloadPathBox>());
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
	path->toggleOn(
 | 
						path->toggleOn(
 | 
				
			||||||
		showpath->events_starting_with(!Global::AskDownloadPath()));
 | 
							showpath->events_starting_with_copy(!Global::AskDownloadPath()));
 | 
				
			||||||
#endif // OS_WIN_STORE
 | 
					#endif // OS_WIN_STORE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	base::ObservableViewer(
 | 
						base::ObservableViewer(
 | 
				
			||||||
		dontask->checkedChanged
 | 
							ask->checkedChanged
 | 
				
			||||||
	) | rpl::start_with_next([=](bool checked) {
 | 
						) | rpl::start_with_next([=](bool checked) {
 | 
				
			||||||
		Global::SetAskDownloadPath(!checked);
 | 
							Global::SetAskDownloadPath(checked);
 | 
				
			||||||
		Local::writeUserSettings();
 | 
							Local::writeUserSettings();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef OS_WIN_STORE
 | 
					#ifndef OS_WIN_STORE
 | 
				
			||||||
		showpath->fire_copy(checked);
 | 
							showpath->fire_copy(!checked);
 | 
				
			||||||
#endif // OS_WIN_STORE
 | 
					#endif // OS_WIN_STORE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	}, inner->lifetime());
 | 
						}, inner->lifetime());
 | 
				
			||||||
| 
						 | 
					@ -548,6 +537,9 @@ void SetupChatOther(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
		Ui::show(Box<AutoDownloadBox>());
 | 
							Ui::show(Box<AutoDownloadBox>());
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						SetupExport(container);
 | 
				
			||||||
 | 
						SetupLocalStorage(container);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	AddSkip(container, st::settingsCheckboxesSkip);
 | 
						AddSkip(container, st::settingsCheckboxesSkip);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -702,9 +694,10 @@ void Chat::setupContent() {
 | 
				
			||||||
	const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
 | 
						const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	SetupStickersEmoji(content);
 | 
						SetupStickersEmoji(content);
 | 
				
			||||||
 | 
						SetupMessages(content);
 | 
				
			||||||
	SetupChatBackground(content);
 | 
						SetupChatBackground(content);
 | 
				
			||||||
	SetupThemeOptions(content);
 | 
						SetupThemeOptions(content);
 | 
				
			||||||
	SetupChatOther(content);
 | 
						SetupDataStorage(content);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	Ui::ResizeFitChild(this, content);
 | 
						Ui::ResizeFitChild(this, content);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -120,15 +120,26 @@ not_null<Button*> AddButton(
 | 
				
			||||||
void CreateRightLabel(
 | 
					void CreateRightLabel(
 | 
				
			||||||
		not_null<Button*> button,
 | 
							not_null<Button*> button,
 | 
				
			||||||
		rpl::producer<QString> label,
 | 
							rpl::producer<QString> label,
 | 
				
			||||||
		const style::InfoProfileButton &st) {
 | 
							const style::InfoProfileButton &st,
 | 
				
			||||||
 | 
							LangKey buttonText) {
 | 
				
			||||||
	const auto name = Ui::CreateChild<Ui::FlatLabel>(
 | 
						const auto name = Ui::CreateChild<Ui::FlatLabel>(
 | 
				
			||||||
		button.get(),
 | 
							button.get(),
 | 
				
			||||||
		std::move(label),
 | 
					 | 
				
			||||||
		st::settingsButtonRight);
 | 
							st::settingsButtonRight);
 | 
				
			||||||
	rpl::combine(
 | 
						rpl::combine(
 | 
				
			||||||
		name->widthValue(),
 | 
							button->widthValue(),
 | 
				
			||||||
		button->widthValue()
 | 
							Lang::Viewer(buttonText),
 | 
				
			||||||
	) | rpl::start_with_next([=] {
 | 
							std::move(label)
 | 
				
			||||||
 | 
						) | rpl::start_with_next([=, &st](
 | 
				
			||||||
 | 
								int width,
 | 
				
			||||||
 | 
								const QString &button,
 | 
				
			||||||
 | 
								const QString &text) {
 | 
				
			||||||
 | 
							const auto available = width
 | 
				
			||||||
 | 
								- st.padding.left()
 | 
				
			||||||
 | 
								- st.padding.right()
 | 
				
			||||||
 | 
								- st.font->width(button)
 | 
				
			||||||
 | 
								- st::settingsButtonRightSkip;
 | 
				
			||||||
 | 
							name->setText(text);
 | 
				
			||||||
 | 
							name->resizeToNaturalWidth(available);
 | 
				
			||||||
		name->moveToRight(st::settingsButtonRightSkip, st.padding.top());
 | 
							name->moveToRight(st::settingsButtonRightSkip, st.padding.top());
 | 
				
			||||||
	}, name->lifetime());
 | 
						}, name->lifetime());
 | 
				
			||||||
	name->setAttribute(Qt::WA_TransparentForMouseEvents);
 | 
						name->setAttribute(Qt::WA_TransparentForMouseEvents);
 | 
				
			||||||
| 
						 | 
					@ -141,7 +152,7 @@ not_null<Button*> AddButtonWithLabel(
 | 
				
			||||||
		const style::InfoProfileButton &st,
 | 
							const style::InfoProfileButton &st,
 | 
				
			||||||
		const style::icon *leftIcon) {
 | 
							const style::icon *leftIcon) {
 | 
				
			||||||
	const auto button = AddButton(container, text, st, leftIcon);
 | 
						const auto button = AddButton(container, text, st, leftIcon);
 | 
				
			||||||
	CreateRightLabel(button, std::move(label), st);
 | 
						CreateRightLabel(button, std::move(label), st, text);
 | 
				
			||||||
	return button;
 | 
						return button;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -89,7 +89,8 @@ not_null<Button*> AddButtonWithLabel(
 | 
				
			||||||
void CreateRightLabel(
 | 
					void CreateRightLabel(
 | 
				
			||||||
	not_null<Button*> button,
 | 
						not_null<Button*> button,
 | 
				
			||||||
	rpl::producer<QString> label,
 | 
						rpl::producer<QString> label,
 | 
				
			||||||
	const style::InfoProfileButton &st);
 | 
						const style::InfoProfileButton &st,
 | 
				
			||||||
 | 
						LangKey buttonText);
 | 
				
			||||||
void AddSubsectionTitle(
 | 
					void AddSubsectionTitle(
 | 
				
			||||||
	not_null<Ui::VerticalLayout*> conatiner,
 | 
						not_null<Ui::VerticalLayout*> conatiner,
 | 
				
			||||||
	LangKey text);
 | 
						LangKey text);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,18 +12,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 | 
				
			||||||
#include "ui/wrap/slide_wrap.h"
 | 
					#include "ui/wrap/slide_wrap.h"
 | 
				
			||||||
#include "ui/widgets/labels.h"
 | 
					#include "ui/widgets/labels.h"
 | 
				
			||||||
#include "ui/widgets/checkbox.h"
 | 
					#include "ui/widgets/checkbox.h"
 | 
				
			||||||
#include "boxes/local_storage_box.h"
 | 
					 | 
				
			||||||
#include "boxes/connection_box.h"
 | 
					#include "boxes/connection_box.h"
 | 
				
			||||||
#include "boxes/about_box.h"
 | 
					#include "boxes/about_box.h"
 | 
				
			||||||
#include "boxes/confirm_box.h"
 | 
					#include "boxes/confirm_box.h"
 | 
				
			||||||
#include "info/profile/info_profile_button.h"
 | 
					#include "info/profile/info_profile_button.h"
 | 
				
			||||||
#include "info/profile/info_profile_values.h"
 | 
					#include "info/profile/info_profile_values.h"
 | 
				
			||||||
#include "data/data_session.h"
 | 
					 | 
				
			||||||
#include "platform/platform_specific.h"
 | 
					#include "platform/platform_specific.h"
 | 
				
			||||||
#include "lang/lang_keys.h"
 | 
					#include "lang/lang_keys.h"
 | 
				
			||||||
#include "core/update_checker.h"
 | 
					#include "core/update_checker.h"
 | 
				
			||||||
#include "storage/localstorage.h"
 | 
					#include "storage/localstorage.h"
 | 
				
			||||||
#include "auth_session.h"
 | 
					 | 
				
			||||||
#include "layout.h"
 | 
					#include "layout.h"
 | 
				
			||||||
#include "styles/style_settings.h"
 | 
					#include "styles/style_settings.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -61,28 +58,13 @@ void SetupConnectionType(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
		) | rpl::then(base::ObservableViewer(
 | 
							) | rpl::then(base::ObservableViewer(
 | 
				
			||||||
			Global::RefConnectionTypeChanged()
 | 
								Global::RefConnectionTypeChanged()
 | 
				
			||||||
		)) | rpl::map(connectionType),
 | 
							)) | rpl::map(connectionType),
 | 
				
			||||||
		st::settingsGeneralButton);
 | 
							st::settingsButton);
 | 
				
			||||||
	button->addClickHandler([] {
 | 
						button->addClickHandler([] {
 | 
				
			||||||
		Ui::show(ProxiesBoxController::CreateOwningBox());
 | 
							Ui::show(ProxiesBoxController::CreateOwningBox());
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
#endif // TDESKTOP_DISABLE_NETWORK_PROXY
 | 
					#endif // TDESKTOP_DISABLE_NETWORK_PROXY
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void SetupStorageAndConnection(not_null<Ui::VerticalLayout*> container) {
 | 
					 | 
				
			||||||
	AddSkip(container);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	AddButton(
 | 
					 | 
				
			||||||
		container,
 | 
					 | 
				
			||||||
		lng_settings_local_storage,
 | 
					 | 
				
			||||||
		st::settingsGeneralButton
 | 
					 | 
				
			||||||
	)->addClickHandler([] {
 | 
					 | 
				
			||||||
		LocalStorageBox::Show(&Auth().data().cache());
 | 
					 | 
				
			||||||
	});
 | 
					 | 
				
			||||||
	SetupConnectionType(container);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	AddSkip(container);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
bool HasUpdate() {
 | 
					bool HasUpdate() {
 | 
				
			||||||
	return !Core::UpdaterDisabled();
 | 
						return !Core::UpdaterDisabled();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -115,7 +97,7 @@ void SetupUpdate(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
		object_ptr<Button>(
 | 
							object_ptr<Button>(
 | 
				
			||||||
			container,
 | 
								container,
 | 
				
			||||||
			Lang::Viewer(lng_settings_check_now),
 | 
								Lang::Viewer(lng_settings_check_now),
 | 
				
			||||||
			st::settingsGeneralButton)));
 | 
								st::settingsButton)));
 | 
				
			||||||
	const auto update = Ui::CreateChild<Button>(
 | 
						const auto update = Ui::CreateChild<Button>(
 | 
				
			||||||
		check->entity(),
 | 
							check->entity(),
 | 
				
			||||||
		Lang::Viewer(lng_update_telegram) | Info::Profile::ToUpperValue(),
 | 
							Lang::Viewer(lng_update_telegram) | Info::Profile::ToUpperValue(),
 | 
				
			||||||
| 
						 | 
					@ -405,17 +387,28 @@ General::General(QWidget *parent, UserData *self)
 | 
				
			||||||
void General::setupContent() {
 | 
					void General::setupContent() {
 | 
				
			||||||
	const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
 | 
						const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!Core::UpdaterDisabled()) {
 | 
						auto empty = true;
 | 
				
			||||||
 | 
						const auto addDivider = [&] {
 | 
				
			||||||
 | 
							if (empty) {
 | 
				
			||||||
 | 
								empty = false;
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								AddDivider(content);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						};
 | 
				
			||||||
 | 
						if (HasConnectionType()) {
 | 
				
			||||||
 | 
							addDivider();
 | 
				
			||||||
 | 
							AddSkip(content);
 | 
				
			||||||
 | 
							SetupConnectionType(content);
 | 
				
			||||||
 | 
							AddSkip(content);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if (HasUpdate()) {
 | 
				
			||||||
 | 
							addDivider();
 | 
				
			||||||
		AddSkip(content);
 | 
							AddSkip(content);
 | 
				
			||||||
		SetupUpdate(content);
 | 
							SetupUpdate(content);
 | 
				
			||||||
		AddSkip(content);
 | 
							AddSkip(content);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (!Core::UpdaterDisabled()) {
 | 
					 | 
				
			||||||
		AddDivider(content);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	SetupStorageAndConnection(content);
 | 
					 | 
				
			||||||
	if (HasTray()) {
 | 
						if (HasTray()) {
 | 
				
			||||||
		AddDivider(content);
 | 
							addDivider();
 | 
				
			||||||
		AddSkip(content);
 | 
							AddSkip(content);
 | 
				
			||||||
		SetupTray(content);
 | 
							SetupTray(content);
 | 
				
			||||||
		AddSkip(content);
 | 
							AddSkip(content);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -57,12 +57,13 @@ private:
 | 
				
			||||||
object_ptr<Ui::RpWidget> CreateIntroSettings(QWidget *parent) {
 | 
					object_ptr<Ui::RpWidget> CreateIntroSettings(QWidget *parent) {
 | 
				
			||||||
	auto result = object_ptr<Ui::VerticalLayout>(parent);
 | 
						auto result = object_ptr<Ui::VerticalLayout>(parent);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (HasConnectionType()) {
 | 
					 | 
				
			||||||
	AddDivider(result);
 | 
						AddDivider(result);
 | 
				
			||||||
	AddSkip(result);
 | 
						AddSkip(result);
 | 
				
			||||||
 | 
						SetupLanguageButton(result, false);
 | 
				
			||||||
 | 
						if (HasConnectionType()) {
 | 
				
			||||||
		SetupConnectionType(result);
 | 
							SetupConnectionType(result);
 | 
				
			||||||
		AddSkip(result);
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						AddSkip(result);
 | 
				
			||||||
	if (HasUpdate()) {
 | 
						if (HasUpdate()) {
 | 
				
			||||||
		AddDivider(result);
 | 
							AddDivider(result);
 | 
				
			||||||
		AddSkip(result);
 | 
							AddSkip(result);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,13 +26,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Settings {
 | 
					namespace Settings {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void SetupLanguageButton(not_null<Ui::VerticalLayout*> container) {
 | 
					void SetupLanguageButton(
 | 
				
			||||||
 | 
							not_null<Ui::VerticalLayout*> container,
 | 
				
			||||||
 | 
							bool icon) {
 | 
				
			||||||
	const auto button = AddButtonWithLabel(
 | 
						const auto button = AddButtonWithLabel(
 | 
				
			||||||
		container,
 | 
							container,
 | 
				
			||||||
		lng_settings_language,
 | 
							lng_settings_language,
 | 
				
			||||||
		Lang::Viewer(lng_language_name),
 | 
							Lang::Viewer(lng_language_name),
 | 
				
			||||||
		st::settingsSectionButton,
 | 
							icon ? st::settingsSectionButton : st::settingsButton,
 | 
				
			||||||
		&st::settingsIconLanguage);
 | 
							icon ? &st::settingsIconLanguage : nullptr);
 | 
				
			||||||
	const auto guard = Ui::AttachAsChild(button, base::binary_guard());
 | 
						const auto guard = Ui::AttachAsChild(button, base::binary_guard());
 | 
				
			||||||
	button->addClickHandler([=] {
 | 
						button->addClickHandler([=] {
 | 
				
			||||||
		*guard = LanguageBox::Show();
 | 
							*guard = LanguageBox::Show();
 | 
				
			||||||
| 
						 | 
					@ -102,7 +104,7 @@ void SetupInterfaceScale(
 | 
				
			||||||
	const auto button = AddButton(
 | 
						const auto button = AddButton(
 | 
				
			||||||
		container,
 | 
							container,
 | 
				
			||||||
		lng_settings_default_scale,
 | 
							lng_settings_default_scale,
 | 
				
			||||||
		icon ? st::settingsSectionButton : st::settingsGeneralButton,
 | 
							icon ? st::settingsSectionButton : st::settingsButton,
 | 
				
			||||||
		icon ? &st::settingsIconInterfaceScale : nullptr
 | 
							icon ? &st::settingsIconInterfaceScale : nullptr
 | 
				
			||||||
	)->toggleOn(toggled->events_starting_with_copy(switched));
 | 
						)->toggleOn(toggled->events_starting_with_copy(switched));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -201,7 +203,7 @@ void SetupFaq(not_null<Ui::VerticalLayout*> container, bool icon) {
 | 
				
			||||||
	AddButton(
 | 
						AddButton(
 | 
				
			||||||
		container,
 | 
							container,
 | 
				
			||||||
		lng_settings_faq,
 | 
							lng_settings_faq,
 | 
				
			||||||
		icon ? st::settingsSectionButton : st::settingsGeneralButton,
 | 
							icon ? st::settingsSectionButton : st::settingsButton,
 | 
				
			||||||
		icon ? &st::settingsIconFaq : nullptr
 | 
							icon ? &st::settingsIconFaq : nullptr
 | 
				
			||||||
	)->addClickHandler([] {
 | 
						)->addClickHandler([] {
 | 
				
			||||||
		QDesktopServices::openUrl(telegramFaqLink());
 | 
							QDesktopServices::openUrl(telegramFaqLink());
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,6 +19,9 @@ class VerticalLayout;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Settings {
 | 
					namespace Settings {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void SetupLanguageButton(
 | 
				
			||||||
 | 
						not_null<Ui::VerticalLayout*> container,
 | 
				
			||||||
 | 
						bool icon = true);
 | 
				
			||||||
bool HasInterfaceScale();
 | 
					bool HasInterfaceScale();
 | 
				
			||||||
void SetupInterfaceScale(
 | 
					void SetupInterfaceScale(
 | 
				
			||||||
	not_null<Ui::VerticalLayout*> container,
 | 
						not_null<Ui::VerticalLayout*> container,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -30,7 +30,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 | 
				
			||||||
#include "auth_session.h"
 | 
					#include "auth_session.h"
 | 
				
			||||||
#include "apiwrap.h"
 | 
					#include "apiwrap.h"
 | 
				
			||||||
#include "styles/style_settings.h"
 | 
					#include "styles/style_settings.h"
 | 
				
			||||||
#include "styles/style_boxes.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Settings {
 | 
					namespace Settings {
 | 
				
			||||||
namespace {
 | 
					namespace {
 | 
				
			||||||
| 
						 | 
					@ -63,7 +62,7 @@ void SetupPrivacy(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
	AddButton(
 | 
						AddButton(
 | 
				
			||||||
		container,
 | 
							container,
 | 
				
			||||||
		lng_settings_blocked_users,
 | 
							lng_settings_blocked_users,
 | 
				
			||||||
		st::settingsPrivacyButton
 | 
							st::settingsButton
 | 
				
			||||||
	)->addClickHandler([] {
 | 
						)->addClickHandler([] {
 | 
				
			||||||
		const auto initBox = [](not_null<PeerListBox*> box) {
 | 
							const auto initBox = [](not_null<PeerListBox*> box) {
 | 
				
			||||||
			box->addButton(langFactory(lng_close), [=] {
 | 
								box->addButton(langFactory(lng_close), [=] {
 | 
				
			||||||
| 
						 | 
					@ -103,7 +102,7 @@ void SetupPrivacy(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
			container,
 | 
								container,
 | 
				
			||||||
			label,
 | 
								label,
 | 
				
			||||||
			PrivacyString(key),
 | 
								PrivacyString(key),
 | 
				
			||||||
			st::settingsPrivacyButton
 | 
								st::settingsButton
 | 
				
			||||||
		)->addClickHandler([=] {
 | 
							)->addClickHandler([=] {
 | 
				
			||||||
			Ui::show(Box<EditPrivacyBox>(
 | 
								Ui::show(Box<EditPrivacyBox>(
 | 
				
			||||||
				controller(),
 | 
									controller(),
 | 
				
			||||||
| 
						 | 
					@ -157,7 +156,7 @@ void SetupLocalPasscode(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
		object_ptr<Button>(
 | 
							object_ptr<Button>(
 | 
				
			||||||
			container,
 | 
								container,
 | 
				
			||||||
			std::move(text),
 | 
								std::move(text),
 | 
				
			||||||
			st::settingsPrivacyButton)
 | 
								st::settingsButton)
 | 
				
			||||||
	)->addClickHandler([] {
 | 
						)->addClickHandler([] {
 | 
				
			||||||
		Ui::show(Box<PasscodeBox>(false));
 | 
							Ui::show(Box<PasscodeBox>(false));
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
| 
						 | 
					@ -171,7 +170,7 @@ void SetupLocalPasscode(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
		object_ptr<Button>(
 | 
							object_ptr<Button>(
 | 
				
			||||||
			inner,
 | 
								inner,
 | 
				
			||||||
			Lang::Viewer(lng_settings_passcode_disable),
 | 
								Lang::Viewer(lng_settings_passcode_disable),
 | 
				
			||||||
			st::settingsPrivacyButton)
 | 
								st::settingsButton)
 | 
				
			||||||
	)->addClickHandler([] {
 | 
						)->addClickHandler([] {
 | 
				
			||||||
		Ui::show(Box<PasscodeBox>(true));
 | 
							Ui::show(Box<PasscodeBox>(true));
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
| 
						 | 
					@ -187,13 +186,12 @@ void SetupLocalPasscode(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
			: lng_passcode_autolock_hours(lt_count, autolock / 3600);
 | 
								: lng_passcode_autolock_hours(lt_count, autolock / 3600);
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const auto autolock = inner->add(
 | 
						AddButtonWithLabel(
 | 
				
			||||||
		object_ptr<Button>(
 | 
					 | 
				
			||||||
		inner,
 | 
							inner,
 | 
				
			||||||
			Lang::Viewer(label),
 | 
							label,
 | 
				
			||||||
			st::settingsPrivacyButton));
 | 
							std::move(value),
 | 
				
			||||||
	CreateRightLabel(autolock, std::move(value), st::settingsPrivacyButton);
 | 
							st::settingsButton
 | 
				
			||||||
	autolock->addClickHandler([] {
 | 
						)->addClickHandler([] {
 | 
				
			||||||
		Ui::show(Box<AutoLockBox>());
 | 
							Ui::show(Box<AutoLockBox>());
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -309,12 +307,12 @@ void SetupCloudPassword(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
				base::duplicate(confirmation),
 | 
									base::duplicate(confirmation),
 | 
				
			||||||
				st::settingsCloudPasswordLabel),
 | 
									st::settingsCloudPasswordLabel),
 | 
				
			||||||
			QMargins(
 | 
								QMargins(
 | 
				
			||||||
				st::settingsPrivacyButton.padding.left(),
 | 
									st::settingsButton.padding.left(),
 | 
				
			||||||
				st::settingsPrivacyButton.padding.top(),
 | 
									st::settingsButton.padding.top(),
 | 
				
			||||||
				st::settingsPrivacyButton.padding.right(),
 | 
									st::settingsButton.padding.right(),
 | 
				
			||||||
				(st::settingsPrivacyButton.height
 | 
									(st::settingsButton.height
 | 
				
			||||||
					- st::settingsCloudPasswordLabel.style.font->height
 | 
										- st::settingsCloudPasswordLabel.style.font->height
 | 
				
			||||||
					+ st::settingsPrivacyButton.padding.bottom()))));
 | 
										+ st::settingsButton.padding.bottom()))));
 | 
				
			||||||
	label->toggleOn(base::duplicate(unconfirmed))->setDuration(0);
 | 
						label->toggleOn(base::duplicate(unconfirmed))->setDuration(0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	std::move(
 | 
						std::move(
 | 
				
			||||||
| 
						 | 
					@ -336,7 +334,7 @@ void SetupCloudPassword(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
			object_ptr<Button>(
 | 
								object_ptr<Button>(
 | 
				
			||||||
				container,
 | 
									container,
 | 
				
			||||||
				std::move(text),
 | 
									std::move(text),
 | 
				
			||||||
				st::settingsPrivacyButton)));
 | 
									st::settingsButton)));
 | 
				
			||||||
	change->toggleOn(std::move(
 | 
						change->toggleOn(std::move(
 | 
				
			||||||
		unconfirmed
 | 
							unconfirmed
 | 
				
			||||||
	) | rpl::map([](bool unconfirmed) {
 | 
						) | rpl::map([](bool unconfirmed) {
 | 
				
			||||||
| 
						 | 
					@ -354,7 +352,7 @@ void SetupCloudPassword(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
			object_ptr<Button>(
 | 
								object_ptr<Button>(
 | 
				
			||||||
				container,
 | 
									container,
 | 
				
			||||||
				Lang::Viewer(lng_settings_password_disable),
 | 
									Lang::Viewer(lng_settings_password_disable),
 | 
				
			||||||
				st::settingsPrivacyButton)));
 | 
									st::settingsButton)));
 | 
				
			||||||
	disable->toggleOn(base::duplicate(has));
 | 
						disable->toggleOn(base::duplicate(has));
 | 
				
			||||||
	disable->entity()->addClickHandler([] {
 | 
						disable->entity()->addClickHandler([] {
 | 
				
			||||||
		if (CheckEditCloudPassword()) {
 | 
							if (CheckEditCloudPassword()) {
 | 
				
			||||||
| 
						 | 
					@ -385,7 +383,7 @@ void SetupSelfDestruction(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
	AddButton(
 | 
						AddButton(
 | 
				
			||||||
		container,
 | 
							container,
 | 
				
			||||||
		lng_settings_self_destruct,
 | 
							lng_settings_self_destruct,
 | 
				
			||||||
		st::settingsPrivacyButton
 | 
							st::settingsButton
 | 
				
			||||||
	)->addClickHandler([] {
 | 
						)->addClickHandler([] {
 | 
				
			||||||
		Ui::show(Box<SelfDestructionBox>());
 | 
							Ui::show(Box<SelfDestructionBox>());
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
| 
						 | 
					@ -401,7 +399,7 @@ void SetupSessionsList(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
	AddButton(
 | 
						AddButton(
 | 
				
			||||||
		container,
 | 
							container,
 | 
				
			||||||
		lng_settings_show_sessions,
 | 
							lng_settings_show_sessions,
 | 
				
			||||||
		st::settingsPrivacyButton
 | 
							st::settingsButton
 | 
				
			||||||
	)->addClickHandler([] {
 | 
						)->addClickHandler([] {
 | 
				
			||||||
		Ui::show(Box<SessionsBox>());
 | 
							Ui::show(Box<SessionsBox>());
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
| 
						 | 
					@ -435,7 +433,7 @@ void SetupCalls(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
		container,
 | 
							container,
 | 
				
			||||||
		lng_settings_peer_to_peer,
 | 
							lng_settings_peer_to_peer,
 | 
				
			||||||
		std::move(text),
 | 
							std::move(text),
 | 
				
			||||||
		st::settingsPrivacyButton
 | 
							st::settingsButton
 | 
				
			||||||
	)->addClickHandler([=] {
 | 
						)->addClickHandler([=] {
 | 
				
			||||||
		Ui::show(Box<EditCallsPeerToPeer>());
 | 
							Ui::show(Box<EditCallsPeerToPeer>());
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
| 
						 | 
					@ -446,24 +444,6 @@ void SetupCalls(not_null<Ui::VerticalLayout*> container) {
 | 
				
			||||||
		Lang::Viewer(lng_settings_peer_to_peer_about));
 | 
							Lang::Viewer(lng_settings_peer_to_peer_about));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void SetupExport(not_null<Ui::VerticalLayout*> container) {
 | 
					 | 
				
			||||||
	AddSkip(container);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	AddButton(
 | 
					 | 
				
			||||||
		container,
 | 
					 | 
				
			||||||
		lng_settings_export_data,
 | 
					 | 
				
			||||||
		st::settingsPrivacyButton
 | 
					 | 
				
			||||||
	)->addClickHandler([] {
 | 
					 | 
				
			||||||
		Ui::hideSettingsAndLayer();
 | 
					 | 
				
			||||||
		App::CallDelayed(
 | 
					 | 
				
			||||||
			st::boxDuration,
 | 
					 | 
				
			||||||
			&Auth(),
 | 
					 | 
				
			||||||
			[] { Auth().data().startExport(); });
 | 
					 | 
				
			||||||
	});
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	AddSkip(container);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
} // namespace
 | 
					} // namespace
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PrivacySecurity::PrivacySecurity(QWidget *parent, not_null<UserData*> self)
 | 
					PrivacySecurity::PrivacySecurity(QWidget *parent, not_null<UserData*> self)
 | 
				
			||||||
| 
						 | 
					@ -481,7 +461,6 @@ void PrivacySecurity::setupContent() {
 | 
				
			||||||
	SetupSessionsList(content);
 | 
						SetupSessionsList(content);
 | 
				
			||||||
	SetupSelfDestruction(content);
 | 
						SetupSelfDestruction(content);
 | 
				
			||||||
	SetupCalls(content);
 | 
						SetupCalls(content);
 | 
				
			||||||
	SetupExport(content);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	Ui::ResizeFitChild(this, content);
 | 
						Ui::ResizeFitChild(this, content);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue