diff --git a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp index f97cfb3d2..8c7c9ee52 100644 --- a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp +++ b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp @@ -62,23 +62,17 @@ base::options::toggle StreamerMode( } ); -not_null AddInnerToggle( - not_null container, - const style::SettingsButton &st, - std::vector> innerCheckViews, - not_null *> wrap, - rpl::producer buttonLabel, - std::optional locked, - bool toggledWhenAll, - Settings::IconDescriptor &&icon) +not_null AddInnerToggle(not_null container, + const style::SettingsButton &st, + std::vector> innerCheckViews, + not_null *> wrap, + rpl::producer buttonLabel, + bool toggledWhenAll) { const auto button = container->add(object_ptr( container, nullptr, - st)); - if (icon) { - AddButtonIcon(button, st, std::move(icon)); - } + st::settingsButtonNoIcon)); const auto toggleButton = Ui::CreateChild( container.get(), @@ -175,7 +169,7 @@ not_null AddInnerToggle( anim::type::normal); } }, toggleButton->lifetime()); - checkView->setLocked(locked.has_value()); + checkView->setLocked(false); checkView->finishAnimating(); const auto label = Ui::CreateChild( @@ -244,31 +238,18 @@ not_null AddInnerToggle( st::slideWrapDuration); }, button->lifetime()); - const auto handleLocked = [=] - { - if (locked.has_value()) { - Ui::Toast::Show(container, *locked); - return true; - } - return false; - }; - button->clicks( ) | start_with_next([=] { - if (!handleLocked()) { - wrap->toggle(!wrap->toggled(), anim::type::normal); - } + wrap->toggle(!wrap->toggled(), anim::type::normal); }, button->lifetime()); toggleButton->clicks( ) | start_with_next([=] { - if (!handleLocked()) { - const auto checked = !checkView->checked(); - for (const auto &innerCheck : state->innerChecks) { - innerCheck->setChecked(checked, anim::type::normal); - } + const auto checked = !checkView->checked(); + for (const auto &innerCheck : state->innerChecks) { + innerCheck->setChecked(checked, anim::type::normal); } }, toggleButton->lifetime()); @@ -476,9 +457,7 @@ void Ayu::SetupGhostModeToggle(not_null container) innerChecks, raw, tr::ayu_GhostModeToggle(), - std::nullopt, - true, - {}); + true); container->add(std::move(wrap)); container->widthValue( ) | start_with_next([=](int w) @@ -598,9 +577,7 @@ void Ayu::SetupReadAfterActionToggle(not_null container) innerChecks, raw, tr::ayu_MarkReadAfterAction(), - std::nullopt, - false, - {}); + false); container->add(std::move(wrap)); container->widthValue( ) | start_with_next([=](int w)