From 5f244cb7cbe8124531fbc31c1d5406ffa43e1de7 Mon Sep 17 00:00:00 2001 From: Neurotoxin001 <39812401+Neurotoxin001@users.noreply.github.com> Date: Wed, 25 Jun 2025 10:29:12 +0300 Subject: [PATCH 1/5] Add settings for forwards count and ratio --- Telegram/Resources/langs/lang.strings | 2 + Telegram/SourceFiles/ayu/ayu_settings.cpp | 10 +++ Telegram/SourceFiles/ayu/ayu_settings.h | 6 ++ .../ayu/ui/settings/settings_ayu.cpp | 39 ++++++++++ .../history/view/history_view_bottom_info.cpp | 76 +++++++++++++++++++ .../history/view/history_view_bottom_info.h | 2 + Telegram/SourceFiles/ui/chat/chat.style | 5 ++ Telegram/SourceFiles/ui/chat/chat_style.cpp | 7 ++ Telegram/SourceFiles/ui/chat/chat_style.h | 5 ++ 9 files changed, 152 insertions(+) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 779778df3e..016d3d3aa9 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -6666,6 +6666,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "ayu_SettingsShowID" = "Show Peer ID"; "ayu_SettingsShowID_Hide" = "Hide"; "ayu_SettingsShowMessageShot" = "Show Message Shot"; +"ayu_ShowForwardsCount" = "Show Forwards"; +"ayu_ShowForwardsRatio" = "Show Forward Ratio"; "ayu_SettingsRecentStickersCount" = "Recent Stickers Count"; "ayu_SettingsCustomizationHint" = "You must restart the application after making changes in the \"Customization\" section."; "ayu_SettingsContextMenuTitle" = "Choose when to show the item"; diff --git a/Telegram/SourceFiles/ayu/ayu_settings.cpp b/Telegram/SourceFiles/ayu/ayu_settings.cpp index e3ea5e76ec..c6b3bda56b 100644 --- a/Telegram/SourceFiles/ayu/ayu_settings.cpp +++ b/Telegram/SourceFiles/ayu/ayu_settings.cpp @@ -294,6 +294,8 @@ AyuGramSettings::AyuGramSettings() { showPeerId = 2; showMessageSeconds = false; showMessageShot = true; + showForwards = true; + showForwardsRatio = false; // ~ Confirmations stickerConfirmation = false; @@ -555,6 +557,14 @@ void set_showMessageShot(bool val) { settings->showMessageShot = val; } +void set_showForwards(bool val) { + settings->showForwards = val; +} + +void set_showForwardsRatio(bool val) { + settings->showForwardsRatio = val; +} + void set_stickerConfirmation(bool val) { settings->stickerConfirmation = val; } diff --git a/Telegram/SourceFiles/ayu/ayu_settings.h b/Telegram/SourceFiles/ayu/ayu_settings.h index 6bbf81c7c7..4dbb331dd6 100644 --- a/Telegram/SourceFiles/ayu/ayu_settings.h +++ b/Telegram/SourceFiles/ayu/ayu_settings.h @@ -91,6 +91,8 @@ public: int showPeerId; bool showMessageSeconds; bool showMessageShot; + bool showForwards; + bool showForwardsRatio; bool stickerConfirmation; bool gifConfirmation; @@ -173,6 +175,8 @@ void set_channelBottomButton(int val); void set_showPeerId(int val); void set_showMessageSeconds(bool val); void set_showMessageShot(bool val); +void set_showForwards(bool val); +void set_showForwardsRatio(bool val); void set_stickerConfirmation(bool val); void set_gifConfirmation(bool val); @@ -236,6 +240,8 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT( showPeerId, showMessageSeconds, showMessageShot, + showForwards, + showForwardsRatio, stickerConfirmation, gifConfirmation, voiceConfirmation diff --git a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp index 9ace785559..d79dbe3185 100644 --- a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp +++ b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp @@ -846,6 +846,45 @@ void SetupQoLToggles(not_null container) { AyuSettings::save(); }, container->lifetime()); + + AddButtonWithIcon( + container, + tr::ayu_ShowForwardsCount(), + st::settingsButtonNoIcon + )->toggleOn( + rpl::single(settings.showForwards) + )->toggledValue( + ) | rpl::filter( + [=](bool enabled) + { + return (enabled != settings.showForwards); + }) | start_with_next( + [=](bool enabled) + { + AyuSettings::set_showForwards(enabled); + AyuSettings::save(); + }, + container->lifetime()); + + AddButtonWithIcon( + container, + tr::ayu_ShowForwardsRatio(), + st::settingsButtonNoIcon + )->toggleOn( + rpl::single(settings.showForwardsRatio) + )->toggledValue( + ) | rpl::filter( + [=](bool enabled) + { + return (enabled != settings.showForwardsRatio); + }) | start_with_next( + [=](bool enabled) + { + AyuSettings::set_showForwardsRatio(enabled); + AyuSettings::save(); + }, + container->lifetime()); + } void SetupAppIcon(not_null container) { diff --git a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp index 8225aa4a99..75c1f2fe76 100644 --- a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp +++ b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp @@ -111,6 +111,7 @@ bool BottomInfo::isWide() const { return (_data.flags & Data::Flag::Edited) || !_data.author.isEmpty() || !_views.isEmpty() + || !_forwards.isEmpty() || !_replies.isEmpty() || _effect; } @@ -158,6 +159,38 @@ TextState BottomInfo::textState( result.customTooltipText = fullViews + fullForwards; } } + if (!_forwards.isEmpty()) { + const auto forwardsWidth = _forwards.maxWidth(); + auto right = width() + - withTicksWidth + - ((_data.flags & Data::Flag::Pinned) ? st::historyPinWidth : 0); + if (!_views.isEmpty()) { + right -= st::historyViewsSpace + st::historyViewsWidth + _views.maxWidth(); + } + right -= st::historyViewsSpace + st::historyViewsWidth + forwardsWidth; + const auto inForwards = QRect( + right, + 0, + withTicksWidth + st::historyViewsWidth, + st::msgDateFont->height + ).contains(position); + if (inForwards) { + result.customTooltip = true; + const auto fullViews = _data.views + ? tr::lng_views_tooltip( + tr::now, + lt_count_decimal, + *_data.views) + : QString(); + const auto fullForwards = _data.forwardsCount + ? ('\n' + tr::lng_forwards_tooltip( + tr::now, + lt_count_decimal, + *_data.forwardsCount)) + : QString(); + result.customTooltipText = fullViews + fullForwards; + } + } const auto inTime = QRect( width() - withTicksWidth, 0, @@ -283,6 +316,21 @@ void BottomInfo::paint( firstLineBottom + st::historyViewsTop, outerWidth); } + if (!_forwards.isEmpty()) { + const auto forwardsWidth = _forwards.maxWidth(); + right -= st::historyViewsSpace + forwardsWidth; + _forwards.drawLeft(p, right, position.y(), forwardsWidth, outerWidth); + + const auto &icon = inverted + ? st->historyForwardsInvertedIcon() + : stm->historyForwardsIcon; + right -= st::historyViewsWidth; + icon.paint( + p, + right, + firstLineBottom + st::historyViewsTop, + outerWidth); + } if (!_replies.isEmpty()) { const auto repliesWidth = _replies.maxWidth(); right -= st::historyViewsSpace + repliesWidth; @@ -409,6 +457,7 @@ QSize BottomInfo::countCurrentSize(int newWidth) { void BottomInfo::layout() { layoutDateText(); layoutViewsText(); + layoutForwardsText(); layoutRepliesText(); layoutEffectText(); initDimensions(); @@ -547,6 +596,28 @@ void BottomInfo::layoutViewsText() { Ui::NameTextOptions()); } +void BottomInfo::layoutForwardsText() { + const auto& settings = AyuSettings::getInstance(); + if (!settings.showForwards + || !_data.forwardsCount + || !_data.forwardsCount.value() + || (_data.flags & Data::Flag::Sending)) { + _forwards.clear(); + return; + } + auto text = Lang::FormatCountToShort(*_data.forwardsCount).string; + if (settings.showForwardsRatio && _data.views && *_data.views > 0) { + const auto percent = (*_data.forwardsCount * 100) + / std::max(*_data.views, 1); + text += " (" + QString::number(percent) + '%'; + text += ')'; + } + _forwards.setText( + st::msgDateTextStyle, + text, + Ui::NameTextOptions()); +} + void BottomInfo::layoutRepliesText() { if (!_data.replies || !*_data.replies @@ -584,6 +655,11 @@ QSize BottomInfo::countOptimalSize() { + _views.maxWidth() + st::historyViewsWidth; } + if (!_forwards.isEmpty()) { + width += st::historyViewsSpace + + _forwards.maxWidth() + + st::historyViewsWidth; + } if (!_replies.isEmpty()) { width += st::historyViewsSpace + _replies.maxWidth() diff --git a/Telegram/SourceFiles/history/view/history_view_bottom_info.h b/Telegram/SourceFiles/history/view/history_view_bottom_info.h index 526275579c..98c7787ba2 100644 --- a/Telegram/SourceFiles/history/view/history_view_bottom_info.h +++ b/Telegram/SourceFiles/history/view/history_view_bottom_info.h @@ -93,6 +93,7 @@ private: void layout(); void layoutDateText(); void layoutViewsText(); + void layoutForwardsText(); void layoutRepliesText(); void layoutEffectText(); @@ -121,6 +122,7 @@ private: Ui::Text::String _authorEditedDate; Ui::Text::String _views; Ui::Text::String _replies; + Ui::Text::String _forwards; std::unique_ptr _effect; mutable ClickHandlerPtr _replayLink; int _effectMaxWidth = 0; diff --git a/Telegram/SourceFiles/ui/chat/chat.style b/Telegram/SourceFiles/ui/chat/chat.style index 23e630236c..f0a727a1c4 100644 --- a/Telegram/SourceFiles/ui/chat/chat.style +++ b/Telegram/SourceFiles/ui/chat/chat.style @@ -299,6 +299,11 @@ historyViewsInSelectedIcon: icon {{ "history_views", msgInDateFgSelected }}; historyViewsOutIcon: icon {{ "history_views", historyOutIconFg }}; historyViewsOutSelectedIcon: icon {{ "history_views", historyOutIconFgSelected }}; historyViewsInvertedIcon: icon {{ "history_views", historySendingInvertedIconFg }}; +historyForwardsInIcon: icon {{ "inline_button_switch", msgInDateFg }}; +historyForwardsInSelectedIcon: icon {{ "inline_button_switch", msgInDateFgSelected }}; +historyForwardsOutIcon: icon {{ "inline_button_switch", historyOutIconFg }}; +historyForwardsOutSelectedIcon: icon {{ "inline_button_switch", historyOutIconFgSelected }}; +historyForwardsInvertedIcon: icon {{ "inline_button_switch", historySendingInvertedIconFg }}; historyRepliesInIcon: icon {{ "history_replies", msgInDateFg }}; historyRepliesInSelectedIcon: icon {{ "history_replies", msgInDateFgSelected }}; historyRepliesOutIcon: icon {{ "history_replies", historyOutIconFg }}; diff --git a/Telegram/SourceFiles/ui/chat/chat_style.cpp b/Telegram/SourceFiles/ui/chat/chat_style.cpp index 8eac60bd3d..8b09aba8f7 100644 --- a/Telegram/SourceFiles/ui/chat/chat_style.cpp +++ b/Telegram/SourceFiles/ui/chat/chat_style.cpp @@ -185,6 +185,7 @@ ChatStyle::ChatStyle(rpl::producer colorIndices) { make(_priceTagTextPalette, st::priceTagTextPalette); make(_historyRepliesInvertedIcon, st::historyRepliesInvertedIcon); make(_historyViewsInvertedIcon, st::historyViewsInvertedIcon); + make(_historyForwardsInvertedIcon, st::historyForwardsInvertedIcon); make(_historyViewsSendingIcon, st::historyViewsSendingIcon); make( _historyViewsSendingInvertedIcon, @@ -346,6 +347,12 @@ ChatStyle::ChatStyle(rpl::producer colorIndices) { st::historyViewsInSelectedIcon, st::historyViewsOutIcon, st::historyViewsOutSelectedIcon); + make( + &MessageStyle::historyForwardsIcon, + st::historyForwardsInIcon, + st::historyForwardsInSelectedIcon, + st::historyForwardsOutIcon, + st::historyForwardsOutSelectedIcon); make( &MessageStyle::historyPinIcon, st::historyPinInIcon, diff --git a/Telegram/SourceFiles/ui/chat/chat_style.h b/Telegram/SourceFiles/ui/chat/chat_style.h index 606cf1d74c..d490f00931 100644 --- a/Telegram/SourceFiles/ui/chat/chat_style.h +++ b/Telegram/SourceFiles/ui/chat/chat_style.h @@ -69,6 +69,7 @@ struct MessageStyle { style::icon tailRight = { Qt::Uninitialized }; style::icon historyRepliesIcon = { Qt::Uninitialized }; style::icon historyViewsIcon = { Qt::Uninitialized }; + style::icon historyForwardsIcon = {Qt::Uninitialized}; style::icon historyPinIcon = { Qt::Uninitialized }; style::icon historySentIcon = { Qt::Uninitialized }; style::icon historyReceivedIcon = { Qt::Uninitialized }; @@ -364,6 +365,9 @@ public: [[nodiscard]] const style::icon &historyViewsInvertedIcon() const { return _historyViewsInvertedIcon; } + [[nodiscard]] const style::icon &historyForwardsInvertedIcon() const { + return _historyForwardsInvertedIcon; + } [[nodiscard]] const style::icon &historyViewsSendingIcon() const { return _historyViewsSendingIcon; } @@ -533,6 +537,7 @@ private: style::icon _historyViewsInvertedIcon = { Qt::Uninitialized }; style::icon _historyViewsSendingIcon = { Qt::Uninitialized }; style::icon _historyViewsSendingInvertedIcon = { Qt::Uninitialized }; + style::icon _historyForwardsInvertedIcon = {Qt::Uninitialized}; style::icon _historyPinInvertedIcon = { Qt::Uninitialized }; style::icon _historySendingIcon = { Qt::Uninitialized }; style::icon _historySendingInvertedIcon = { Qt::Uninitialized }; From 90333c127c58090f1602b2011c476797269bb415 Mon Sep 17 00:00:00 2001 From: Neurotoxin001 <39812401+Neurotoxin001@users.noreply.github.com> Date: Thu, 26 Jun 2025 20:38:06 +0300 Subject: [PATCH 2/5] Update ayu_settings.h --- Telegram/SourceFiles/ayu/ayu_settings.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/ayu/ayu_settings.h b/Telegram/SourceFiles/ayu/ayu_settings.h index 0fb466cfdf..642f8c6723 100644 --- a/Telegram/SourceFiles/ayu/ayu_settings.h +++ b/Telegram/SourceFiles/ayu/ayu_settings.h @@ -267,8 +267,8 @@ inline void to_json(nlohmann::json &nlohmann_json_j, const AyuGramSettings &nloh NLOHMANN_JSON_TO(showMessageSeconds) NLOHMANN_JSON_TO(showMessageShot) NLOHMANN_JSON_TO(stickerConfirmation) - NLOHMANN_JSON_TO(showForwards) - NLOHMANN_JSON_TO(showForwardsRatio) + NLOHMANN_JSON_TO(showForwards) + NLOHMANN_JSON_TO(showForwardsRatio) NLOHMANN_JSON_TO(gifConfirmation) NLOHMANN_JSON_TO(voiceConfirmation) } @@ -332,8 +332,8 @@ inline void from_json(const nlohmann::json &nlohmann_json_j, AyuGramSettings &nl NLOHMANN_JSON_FROM_WITH_DEFAULT(showMessageSeconds) NLOHMANN_JSON_FROM_WITH_DEFAULT(showMessageShot) NLOHMANN_JSON_FROM_WITH_DEFAULT(stickerConfirmation) - NLOHMANN_JSON_FROM_WITH_DEFAULT(showForwards) - NLOHMANN_JSON_FROM_WITH_DEFAULT(showForwardsRatio) + NLOHMANN_JSON_FROM_WITH_DEFAULT(showForwards) + NLOHMANN_JSON_FROM_WITH_DEFAULT(showForwardsRatio) NLOHMANN_JSON_FROM_WITH_DEFAULT(gifConfirmation) NLOHMANN_JSON_FROM_WITH_DEFAULT(voiceConfirmation) } From fdd22cdf4e6f80b2498115fdc143012e970005be Mon Sep 17 00:00:00 2001 From: Neurotoxin001 <39812401+Neurotoxin001@users.noreply.github.com> Date: Thu, 26 Jun 2025 21:03:04 +0300 Subject: [PATCH 3/5] Update ayu_settings.h --- Telegram/SourceFiles/ayu/ayu_settings.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/ayu/ayu_settings.h b/Telegram/SourceFiles/ayu/ayu_settings.h index 642f8c6723..d88e7c6e61 100644 --- a/Telegram/SourceFiles/ayu/ayu_settings.h +++ b/Telegram/SourceFiles/ayu/ayu_settings.h @@ -267,8 +267,8 @@ inline void to_json(nlohmann::json &nlohmann_json_j, const AyuGramSettings &nloh NLOHMANN_JSON_TO(showMessageSeconds) NLOHMANN_JSON_TO(showMessageShot) NLOHMANN_JSON_TO(stickerConfirmation) - NLOHMANN_JSON_TO(showForwards) - NLOHMANN_JSON_TO(showForwardsRatio) + NLOHMANN_JSON_TO(showForwards) + NLOHMANN_JSON_TO(showForwardsRatio) NLOHMANN_JSON_TO(gifConfirmation) NLOHMANN_JSON_TO(voiceConfirmation) } @@ -332,8 +332,8 @@ inline void from_json(const nlohmann::json &nlohmann_json_j, AyuGramSettings &nl NLOHMANN_JSON_FROM_WITH_DEFAULT(showMessageSeconds) NLOHMANN_JSON_FROM_WITH_DEFAULT(showMessageShot) NLOHMANN_JSON_FROM_WITH_DEFAULT(stickerConfirmation) - NLOHMANN_JSON_FROM_WITH_DEFAULT(showForwards) - NLOHMANN_JSON_FROM_WITH_DEFAULT(showForwardsRatio) + NLOHMANN_JSON_FROM_WITH_DEFAULT(showForwards) + NLOHMANN_JSON_FROM_WITH_DEFAULT(showForwardsRatio) NLOHMANN_JSON_FROM_WITH_DEFAULT(gifConfirmation) NLOHMANN_JSON_FROM_WITH_DEFAULT(voiceConfirmation) } From 8bea85e597059c37757b92a7370bdd5e6821b160 Mon Sep 17 00:00:00 2001 From: Neurotoxin001 <39812401+Neurotoxin001@users.noreply.github.com> Date: Thu, 10 Jul 2025 14:38:06 +0300 Subject: [PATCH 4/5] Update settings_ayu.cpp --- .../ayu/ui/settings/settings_ayu.cpp | 113 ++++++++++++------ 1 file changed, 77 insertions(+), 36 deletions(-) diff --git a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp index 22fbb9be0c..adff8b96f5 100644 --- a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp +++ b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp @@ -846,44 +846,85 @@ void SetupQoLToggles(not_null container) { }, container->lifetime()); - AddButtonWithIcon( - container, - tr::ayu_ShowForwardsCount(), - st::settingsButtonNoIcon - )->toggleOn( - rpl::single(settings.showForwards) - )->toggledValue( - ) | rpl::filter( - [=](bool enabled) - { - return (enabled != settings.showForwards); - }) | start_with_next( - [=](bool enabled) - { - AyuSettings::set_showForwards(enabled); - AyuSettings::save(); - }, - container->lifetime()); + AddSkip(container); + AddDivider(container); + AddSkip(container); - AddButtonWithIcon( - container, - tr::ayu_ShowForwardsRatio(), - st::settingsButtonNoIcon - )->toggleOn( - rpl::single(settings.showForwardsRatio) - )->toggledValue( - ) | rpl::filter( - [=](bool enabled) - { - return (enabled != settings.showForwardsRatio); - }) | start_with_next( - [=](bool enabled) - { - AyuSettings::set_showForwardsRatio(enabled); - AyuSettings::save(); - }, - container->lifetime()); + AddButtonWithIcon( + container, + tr::ayu_HideChannelReactions(), + st::settingsButtonNoIcon + )->toggleOn( + rpl::single(!settings->hideChannelReactions) + )->toggledValue( + ) | rpl::filter( + [=](bool enabled) + { + return (!enabled != settings->hideChannelReactions); + }) | start_with_next( + [=](bool enabled) + { + AyuSettings::set_hideChannelReactions(!enabled); + AyuSettings::save(); + }, + container->lifetime()); + AddButtonWithIcon( + container, + tr::ayu_HideGroupReactions(), + st::settingsButtonNoIcon + )->toggleOn( + rpl::single(!settings->hideGroupReactions) + )->toggledValue( + ) | rpl::filter( + [=](bool enabled) + { + return (!enabled != settings->hideGroupReactions); + }) | start_with_next( + [=](bool enabled) + { + AyuSettings::set_hideGroupReactions(!enabled); + AyuSettings::save(); + }, + container->lifetime()); + + AddButtonWithIcon( + container, + tr::ayu_ShowForwardsCount(), + st::settingsButtonNoIcon + )->toggleOn( + rpl::single(settings.showForwards) + )->toggledValue( + ) | rpl::filter( + [=](bool enabled) + { + return (enabled != settings.showForwards); + }) | start_with_next( + [=](bool enabled) + { + AyuSettings::set_showForwards(enabled); + AyuSettings::save(); + }, + container->lifetime()); + + AddButtonWithIcon( + container, + tr::ayu_ShowForwardsRatio(), + st::settingsButtonNoIcon + )->toggleOn( + rpl::single(settings.showForwardsRatio) + )->toggledValue( + ) | rpl::filter( + [=](bool enabled) + { + return (enabled != settings.showForwardsRatio); + }) | start_with_next( + [=](bool enabled) + { + AyuSettings::set_showForwardsRatio(enabled); + AyuSettings::save(); + }, + container->lifetime()); } void SetupAppIcon(not_null container) { From 12f0b9ef26f6c02336c6f5eee96d6134d161615c Mon Sep 17 00:00:00 2001 From: Neurotoxin001 <39812401+Neurotoxin001@users.noreply.github.com> Date: Thu, 10 Jul 2025 16:29:26 +0300 Subject: [PATCH 5/5] Update settings_ayu.cpp fix build --- Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp index adff8b96f5..1f1cd68c6e 100644 --- a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp +++ b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp @@ -893,12 +893,12 @@ void SetupQoLToggles(not_null container) { tr::ayu_ShowForwardsCount(), st::settingsButtonNoIcon )->toggleOn( - rpl::single(settings.showForwards) + rpl::single(settings->showForwards) )->toggledValue( ) | rpl::filter( [=](bool enabled) { - return (enabled != settings.showForwards); + return (enabled != settings->showForwards); }) | start_with_next( [=](bool enabled) { @@ -912,12 +912,12 @@ void SetupQoLToggles(not_null container) { tr::ayu_ShowForwardsRatio(), st::settingsButtonNoIcon )->toggleOn( - rpl::single(settings.showForwardsRatio) + rpl::single(settings->showForwardsRatio) )->toggledValue( ) | rpl::filter( [=](bool enabled) { - return (enabled != settings.showForwardsRatio); + return (enabled != settings->showForwardsRatio); }) | start_with_next( [=](bool enabled) {