| 385 | } |
| 386 | |
| 387 | Ui::Checkbox *SectionBuilder::addCheckbox(CheckboxArgs &&args) { |
| 388 | const auto factory = [&](not_null<Ui::VerticalLayout*> container) { |
| 389 | return object_ptr<Ui::Checkbox>( |
| 390 | container, |
| 391 | ResolveTitle(rpl::duplicate(args.title)), |
| 392 | args.checked, |
| 393 | st::settingsCheckbox); |
| 394 | }; |
| 395 | return static_cast<Ui::Checkbox*>(addControl({ |
| 396 | .factory = factory, |
| 397 | .id = std::move(args.id), |
| 398 | .title = rpl::duplicate(args.title), |
| 399 | .margin = st::settingsCheckboxPadding, |
| 400 | .highlight = std::move(args.highlight), |
| 401 | .shown = std::move(args.shown), |
| 402 | .keywords = std::move(args.keywords), |
| 403 | .searchCheckIcon = (args.checked |
| 404 | ? SearchEntryCheckIcon::Checked |
| 405 | : SearchEntryCheckIcon::Unchecked), |
| 406 | })); |
| 407 | } |
| 408 | |
| 409 | void SectionBuilder::addSubsectionTitle(SubsectionTitleArgs &&args) { |
| 410 | v::match(_context, [&](const WidgetContext &ctx) { |
no test coverage detected