single_choice_box.h 785 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. #include "ui/layers/generic_box.h"
  9. #include "base/required.h"
  10. namespace style {
  11. struct Checkbox;
  12. struct Radio;
  13. } // namespace style
  14. struct SingleChoiceBoxArgs {
  15. template <typename T>
  16. using required = base::required<T>;
  17. required<rpl::producer<QString>> title;
  18. const std::vector<QString> &options;
  19. int initialSelection = 0;
  20. required<Fn<void(int)>> callback;
  21. const style::Checkbox *st = nullptr;
  22. const style::Radio *radioSt = nullptr;
  23. };
  24. void SingleChoiceBox(
  25. not_null<Ui::GenericBox*> box,
  26. SingleChoiceBoxArgs &&args);