2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Moved AddSkip and AddDivier from Settings namespace to separate module.

This commit is contained in:
23rd
2023-11-14 22:12:53 +03:00
parent 497aa6dbc8
commit f6cb9072d2
69 changed files with 666 additions and 621 deletions

View File

@@ -45,6 +45,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/widgets/buttons.h"
#include "ui/widgets/checkbox.h"
#include "ui/layers/generic_box.h"
#include "ui/vertical_list.h"
#include "calls/calls_instance.h"
#include "core/core_cloud_password.h"
#include "core/update_checker.h"
@@ -253,8 +254,8 @@ void SetupPrivacy(
not_null<Window::SessionController*> controller,
not_null<Ui::VerticalLayout*> container,
rpl::producer<> updateTrigger) {
AddSkip(container, st::settingsPrivacySkip);
AddSubsectionTitle(container, tr::lng_settings_privacy_title());
Ui::AddSkip(container, st::settingsPrivacySkip);
Ui::AddSubsectionTitle(container, tr::lng_settings_privacy_title());
const auto session = &controller->session();
@@ -310,8 +311,8 @@ void SetupPrivacy(
session->api().userPrivacy().reload(Api::UserPrivacy::Key::AddedByPhone);
AddSkip(container, st::settingsPrivacySecurityPadding);
AddDivider(container);
Ui::AddSkip(container, st::settingsPrivacySecurityPadding);
Ui::AddDivider(container);
}
void SetupLocalPasscode(
@@ -426,8 +427,8 @@ void SetupSensitiveContent(
object_ptr<Ui::VerticalLayout>(container)));
const auto inner = wrap->entity();
AddSkip(inner);
AddSubsectionTitle(inner, tr::lng_settings_sensitive_title());
Ui::AddSkip(inner);
Ui::AddSubsectionTitle(inner, tr::lng_settings_sensitive_title());
const auto session = &controller->session();
@@ -449,8 +450,8 @@ void SetupSensitiveContent(
session->api().sensitiveContent().update(toggled);
}, container->lifetime());
AddSkip(inner);
AddDividerText(inner, tr::lng_settings_sensitive_about());
Ui::AddSkip(inner);
Ui::AddDividerText(inner, tr::lng_settings_sensitive_about());
wrap->toggleOn(session->api().sensitiveContent().canChange());
}
@@ -459,8 +460,8 @@ void SetupSelfDestruction(
not_null<Window::SessionController*> controller,
not_null<Ui::VerticalLayout*> container,
rpl::producer<> updateTrigger) {
AddSkip(container);
AddSubsectionTitle(container, tr::lng_settings_destroy_title());
Ui::AddSkip(container);
Ui::AddSubsectionTitle(container, tr::lng_settings_destroy_title());
const auto session = &controller->session();
@@ -486,7 +487,7 @@ void SetupSelfDestruction(
session->api().selfDestruct().daysAccountTTL()));
});
AddSkip(container);
Ui::AddSkip(container);
}
void ClearPaymentInfoBoxBuilder(
@@ -551,8 +552,8 @@ auto ClearPaymentInfoBox(not_null<Main::Session*> session) {
void SetupBotsAndWebsites(
not_null<Window::SessionController*> controller,
not_null<Ui::VerticalLayout*> container) {
AddSkip(container);
AddSubsectionTitle(container, tr::lng_settings_security_bots());
Ui::AddSkip(container);
Ui::AddSubsectionTitle(container, tr::lng_settings_security_bots());
const auto session = &controller->session();
AddButton(
@@ -563,7 +564,7 @@ void SetupBotsAndWebsites(
controller->show(ClearPaymentInfoBox(session));
});
AddSkip(container);
Ui::AddSkip(container);
}
void SetupBlockedList(
@@ -658,8 +659,8 @@ void SetupSessionsList(
showOther(Sessions::Id());
});
AddSkip(container);
AddDividerText(container, tr::lng_settings_sessions_about());
Ui::AddSkip(container);
Ui::AddDividerText(container, tr::lng_settings_sessions_about());
}
void SetupGlobalTTLList(
@@ -695,8 +696,8 @@ void SetupSecurity(
not_null<Ui::VerticalLayout*> container,
rpl::producer<> updateTrigger,
Fn<void(Type)> showOther) {
AddSkip(container, st::settingsPrivacySkip);
AddSubsectionTitle(container, tr::lng_settings_security());
Ui::AddSkip(container, st::settingsPrivacySkip);
Ui::AddSubsectionTitle(container, tr::lng_settings_security());
SetupCloudPassword(controller, container, showOther);
SetupGlobalTTLList(
@@ -848,8 +849,8 @@ void SetupArchiveAndMute(
object_ptr<Ui::VerticalLayout>(container)));
const auto inner = wrap->entity();
AddSkip(inner);
AddSubsectionTitle(inner, tr::lng_settings_new_unknown());
Ui::AddSkip(inner);
Ui::AddSubsectionTitle(inner, tr::lng_settings_new_unknown());
const auto session = &controller->session();
@@ -868,8 +869,8 @@ void SetupArchiveAndMute(
privacy->updateArchiveAndMute(toggled);
}, container->lifetime());
AddSkip(inner);
AddDividerText(inner, tr::lng_settings_auto_archive_about());
Ui::AddSkip(inner);
Ui::AddDividerText(inner, tr::lng_settings_auto_archive_about());
auto shown = rpl::single(
false