2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Allow adding Settings::Section-s without changing Type.

This commit is contained in:
John Preston
2022-04-01 15:53:23 +04:00
parent 6716c08306
commit aa7143a831
56 changed files with 318 additions and 179 deletions

View File

@@ -10,6 +10,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "settings/settings_common.h"
#include "settings/settings_codes.h"
#include "settings/settings_chat.h"
#include "settings/settings_information.h"
#include "settings/settings_notifications.h"
#include "settings/settings_privacy_security.h"
#include "settings/settings_advanced.h"
#include "settings/settings_folders.h"
#include "settings/settings_calls.h"
#include "boxes/language_box.h"
#include "boxes/username_box.h"
#include "ui/boxes/confirm_box.h"
@@ -251,20 +257,20 @@ void SetupSections(
} else {
addSection(
tr::lng_settings_information(),
Type::Information,
Information::Id(),
{ &st::settingsIconAccount, kIconLightOrange });
}
addSection(
tr::lng_settings_section_notify(),
Type::Notifications,
Notifications::Id(),
{ &st::settingsIconNotifications, kIconRed });
addSection(
tr::lng_settings_section_privacy(),
Type::PrivacySecurity,
PrivacySecurity::Id(),
{ &st::settingsIconLock, kIconGreen });
addSection(
tr::lng_settings_section_chat_settings(),
Type::Chat,
Chat::Id(),
{ &st::settingsIconChat, kIconLightBlue });
const auto preload = [=] {
@@ -307,16 +313,16 @@ void SetupSections(
) | rpl::before_next(preloadIfEnabled));
}
slided->entity()->setClickedCallback([=] {
showOther(Type::Folders);
showOther(Folders::Id());
});
addSection(
tr::lng_settings_advanced(),
Type::Advanced,
Advanced::Id(),
{ &st::settingsIconGeneral, kIconPurple });
addSection(
tr::lng_settings_section_call_settings(),
Type::Calls,
Calls::Id(),
{ &st::settingsIconCalls, kIconGreen });
SetupLanguageButton(container);
@@ -524,6 +530,10 @@ Main::Main(
setupContent(controller);
}
rpl::producer<QString> Main::Title() {
return tr::lng_menu_settings();
}
void Main::keyPressEvent(QKeyEvent *e) {
crl::on_main(this, [=, text = e->text()]{
CodesFeedString(_controller, text);