Moved some settings in separate section
This commit is contained in:
parent
cb69c37664
commit
feb5d8e493
4 changed files with 77 additions and 65 deletions
|
|
@ -2473,4 +2473,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
"ktg_settings_top_bar_mute" = "Mute in profile top bar";
|
||||
|
||||
"ktg_settings_messages" = "Messages";
|
||||
|
||||
// Keys finished
|
||||
|
|
|
|||
|
|
@ -105,5 +105,6 @@
|
|||
"ktg_settings_filters_only_unmuted_counter": "Не считать чаты без уведомлений",
|
||||
"ktg_settings_filters_hide_edit": "Скрыть кнопку изменения",
|
||||
"ktg_settings_filters_hide_folder_names": "Компактные папки",
|
||||
"ktg_settings_top_bar_mute": "Уведомления вверху профиля"
|
||||
"ktg_settings_top_bar_mute": "Уведомления вверху профиля",
|
||||
"ktg_settings_messages": "Сообщения"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,34 +42,6 @@ void SetupKotatoChats(not_null<Ui::VerticalLayout*> container) {
|
|||
AddSkip(container);
|
||||
AddSubsectionTitle(container, tr::ktg_settings_chats());
|
||||
|
||||
const auto stickerHeightLabel = container->add(
|
||||
object_ptr<Ui::LabelSimple>(
|
||||
container,
|
||||
st::settingsAudioVolumeLabel),
|
||||
st::settingsAudioVolumeLabelPadding);
|
||||
const auto stickerHeightSlider = container->add(
|
||||
object_ptr<Ui::MediaSlider>(
|
||||
container,
|
||||
st::settingsAudioVolumeSlider),
|
||||
st::settingsAudioVolumeSliderPadding);
|
||||
const auto updateStickerHeightLabel = [=](int value) {
|
||||
const auto pixels = QString::number(value);
|
||||
stickerHeightLabel->setText(
|
||||
tr::ktg_settings_sticker_height(tr::now, lt_pixels, pixels));
|
||||
};
|
||||
const auto updateStickerHeight = [=](int value) {
|
||||
updateStickerHeightLabel(value);
|
||||
SetStickerHeight(value);
|
||||
KotatoSettings::Write();
|
||||
};
|
||||
stickerHeightSlider->resize(st::settingsAudioVolumeSlider.seekSize);
|
||||
stickerHeightSlider->setPseudoDiscrete(
|
||||
193,
|
||||
[](int val) { return val + 64; },
|
||||
StickerHeight(),
|
||||
updateStickerHeight);
|
||||
updateStickerHeightLabel(StickerHeight());
|
||||
|
||||
const auto recentStickersLimitLabel = container->add(
|
||||
object_ptr<Ui::LabelSimple>(
|
||||
container,
|
||||
|
|
@ -104,29 +76,29 @@ void SetupKotatoChats(not_null<Ui::VerticalLayout*> container) {
|
|||
|
||||
AddButton(
|
||||
container,
|
||||
tr::ktg_settings_adaptive_bubbles(),
|
||||
tr::ktg_settings_top_bar_mute(),
|
||||
st::settingsButton
|
||||
)->toggleOn(
|
||||
rpl::single(AdaptiveBubbles())
|
||||
rpl::single(cProfileTopBarNotifications())
|
||||
)->toggledValue(
|
||||
) | rpl::filter([](bool enabled) {
|
||||
return (enabled != AdaptiveBubbles());
|
||||
return (enabled != cProfileTopBarNotifications());
|
||||
}) | rpl::start_with_next([](bool enabled) {
|
||||
SetAdaptiveBubbles(enabled);
|
||||
cSetProfileTopBarNotifications(enabled);
|
||||
KotatoSettings::Write();
|
||||
}, container->lifetime());
|
||||
|
||||
AddButton(
|
||||
container,
|
||||
tr::ktg_settings_emoji_outline(),
|
||||
tr::ktg_settings_disable_up_edit(),
|
||||
st::settingsButton
|
||||
)->toggleOn(
|
||||
rpl::single(BigEmojiOutline())
|
||||
rpl::single(cDisableUpEdit())
|
||||
)->toggledValue(
|
||||
) | rpl::filter([](bool enabled) {
|
||||
return (enabled != BigEmojiOutline());
|
||||
return (enabled != cDisableUpEdit());
|
||||
}) | rpl::start_with_next([](bool enabled) {
|
||||
SetBigEmojiOutline(enabled);
|
||||
cSetDisableUpEdit(enabled);
|
||||
KotatoSettings::Write();
|
||||
}, container->lifetime());
|
||||
|
||||
|
|
@ -159,34 +131,6 @@ void SetupKotatoChats(not_null<Ui::VerticalLayout*> container) {
|
|||
KotatoSettings::Write();
|
||||
}, container->lifetime());
|
||||
|
||||
AddButton(
|
||||
container,
|
||||
tr::ktg_settings_disable_up_edit(),
|
||||
st::settingsButton
|
||||
)->toggleOn(
|
||||
rpl::single(cDisableUpEdit())
|
||||
)->toggledValue(
|
||||
) | rpl::filter([](bool enabled) {
|
||||
return (enabled != cDisableUpEdit());
|
||||
}) | rpl::start_with_next([](bool enabled) {
|
||||
cSetDisableUpEdit(enabled);
|
||||
KotatoSettings::Write();
|
||||
}, container->lifetime());
|
||||
|
||||
AddButton(
|
||||
container,
|
||||
tr::ktg_settings_top_bar_mute(),
|
||||
st::settingsButton
|
||||
)->toggleOn(
|
||||
rpl::single(cProfileTopBarNotifications())
|
||||
)->toggledValue(
|
||||
) | rpl::filter([](bool enabled) {
|
||||
return (enabled != cProfileTopBarNotifications());
|
||||
}) | rpl::start_with_next([](bool enabled) {
|
||||
cSetProfileTopBarNotifications(enabled);
|
||||
KotatoSettings::Write();
|
||||
}, container->lifetime());
|
||||
|
||||
AddButton(
|
||||
container,
|
||||
tr::ktg_settings_fonts(),
|
||||
|
|
@ -195,6 +139,69 @@ void SetupKotatoChats(not_null<Ui::VerticalLayout*> container) {
|
|||
Ui::show(Box<FontsBox>());
|
||||
});
|
||||
|
||||
AddSkip(container);
|
||||
}
|
||||
|
||||
void SetupKotatoMessages(not_null<Ui::VerticalLayout*> container) {
|
||||
AddDivider(container);
|
||||
AddSkip(container);
|
||||
AddSubsectionTitle(container, tr::ktg_settings_messages());
|
||||
|
||||
const auto stickerHeightLabel = container->add(
|
||||
object_ptr<Ui::LabelSimple>(
|
||||
container,
|
||||
st::settingsAudioVolumeLabel),
|
||||
st::settingsAudioVolumeLabelPadding);
|
||||
const auto stickerHeightSlider = container->add(
|
||||
object_ptr<Ui::MediaSlider>(
|
||||
container,
|
||||
st::settingsAudioVolumeSlider),
|
||||
st::settingsAudioVolumeSliderPadding);
|
||||
const auto updateStickerHeightLabel = [=](int value) {
|
||||
const auto pixels = QString::number(value);
|
||||
stickerHeightLabel->setText(
|
||||
tr::ktg_settings_sticker_height(tr::now, lt_pixels, pixels));
|
||||
};
|
||||
const auto updateStickerHeight = [=](int value) {
|
||||
updateStickerHeightLabel(value);
|
||||
SetStickerHeight(value);
|
||||
KotatoSettings::Write();
|
||||
};
|
||||
stickerHeightSlider->resize(st::settingsAudioVolumeSlider.seekSize);
|
||||
stickerHeightSlider->setPseudoDiscrete(
|
||||
193,
|
||||
[](int val) { return val + 64; },
|
||||
StickerHeight(),
|
||||
updateStickerHeight);
|
||||
updateStickerHeightLabel(StickerHeight());
|
||||
|
||||
AddButton(
|
||||
container,
|
||||
tr::ktg_settings_adaptive_bubbles(),
|
||||
st::settingsButton
|
||||
)->toggleOn(
|
||||
rpl::single(AdaptiveBubbles())
|
||||
)->toggledValue(
|
||||
) | rpl::filter([](bool enabled) {
|
||||
return (enabled != AdaptiveBubbles());
|
||||
}) | rpl::start_with_next([](bool enabled) {
|
||||
SetAdaptiveBubbles(enabled);
|
||||
KotatoSettings::Write();
|
||||
}, container->lifetime());
|
||||
|
||||
AddButton(
|
||||
container,
|
||||
tr::ktg_settings_emoji_outline(),
|
||||
st::settingsButton
|
||||
)->toggleOn(
|
||||
rpl::single(BigEmojiOutline())
|
||||
)->toggledValue(
|
||||
) | rpl::filter([](bool enabled) {
|
||||
return (enabled != BigEmojiOutline());
|
||||
}) | rpl::start_with_next([](bool enabled) {
|
||||
SetBigEmojiOutline(enabled);
|
||||
KotatoSettings::Write();
|
||||
}, container->lifetime());
|
||||
|
||||
AddSkip(container);
|
||||
}
|
||||
|
|
@ -357,6 +364,7 @@ void Kotato::setupContent(not_null<Window::SessionController*> controller) {
|
|||
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
|
||||
|
||||
SetupKotatoChats(content);
|
||||
SetupKotatoMessages(content);
|
||||
SetupKotatoNetwork(content);
|
||||
SetupKotatoFolders(controller, content);
|
||||
SetupKotatoSystem(content);
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ class BoxContent;
|
|||
namespace Settings {
|
||||
|
||||
void SetupKotatoChats(not_null<Ui::VerticalLayout*> container);
|
||||
void SetupKotatoMessages(not_null<Ui::VerticalLayout*> container);
|
||||
void SetupKotatoNetwork(not_null<Ui::VerticalLayout*> container);
|
||||
void SetupKotatoFolders(
|
||||
not_null<Window::SessionController*> controller,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue