diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index ca1ed773c8..7380587e74 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -7990,6 +7990,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "ayu_DontSendUploadProgress" = "Don't Send Typing"; "ayu_SendOfflinePacketAfterOnline" = "Go Offline Automatically"; "ayu_GhostModeOptionLongTapDescription" = "Long-press any option to prevent it from changing when toggling Ghost Mode."; +"ayu_GhostModeOptionShiftDescription" = "Click with SHIFT on any option to prevent it from changing when toggling Ghost Mode."; "ayu_MarkReadAfterAction" = "Read on Interact"; "ayu_MarkReadAfterActionDescription" = "Automatically marks a message as read when you send a new one or tap a reaction."; "ayu_MarkReadAfterSend" = "Send"; diff --git a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp index 7b29799643..b03f308f73 100644 --- a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp +++ b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp @@ -372,7 +372,11 @@ void BuildGhostEssentials(SectionBuilder &builder) { }; auto collapsible = AddCollapsibleToggle( - container, tr::ayu_GhostModeToggle(), std::move(checkboxes), true); + container, + tr::ayu_GhostModeToggle(), + std::move(checkboxes), + true, + tr::ayu_GhostModeOptionShiftDescription(tr::now)); state->refreshCheckboxes = std::move(collapsible.refresh); if (wctx.highlights && collapsible.widget) { wctx.highlights->push_back(std::make_pair( diff --git a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu_utils.cpp b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu_utils.cpp index 9d23e83564..e32f664a67 100644 --- a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu_utils.cpp +++ b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu_utils.cpp @@ -325,7 +325,8 @@ not_null AddInnerToggle(not_null container, CollapsibleToggleResult AddCollapsibleToggle(not_null container, rpl::producer title, std::vector checkboxes, - bool toggledWhenAll) { + bool toggledWhenAll, + QString description) { struct CheckboxEntry { not_null checkView; Ui::Checkbox *checkbox = nullptr; @@ -417,12 +418,6 @@ CollapsibleToggleResult AddCollapsibleToggle(not_null conta anim::type::normal); }); - checkView->checkedChanges( - ) | on_next([=](bool checked) - { - }, - verticalLayout->lifetime()); - checkView->checkedValue( ) | on_next([=](bool enabled) { @@ -440,6 +435,11 @@ CollapsibleToggleResult AddCollapsibleToggle(not_null conta } } + if (!description.isEmpty()) { + Ui::AddDividerText(verticalLayout, rpl::single(std::move(description))); + Ui::AddSkip(verticalLayout); + } + // Apply initial lock visuals. for (auto i = 0u; i < cState->entries.size(); ++i) { const auto &entry = cState->checkboxes[i]; diff --git a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu_utils.h b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu_utils.h index 592be2b4af..bbf4faa1e1 100644 --- a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu_utils.h +++ b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu_utils.h @@ -51,7 +51,8 @@ struct CollapsibleToggleResult { CollapsibleToggleResult AddCollapsibleToggle(not_null container, rpl::producer title, std::vector checkboxes, - bool toggledWhenAll); + bool toggledWhenAll, + QString description = QString()); void AddChooseButtonWithIconAndRightTextInner(not_null container, not_null controller,