calls_group_common.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #include "calls/group/calls_group_common.h"
  8. #include "base/platform/base_platform_info.h"
  9. #include "ui/widgets/labels.h"
  10. #include "ui/layers/generic_box.h"
  11. #include "ui/text/text_utilities.h"
  12. #include "lang/lang_keys.h"
  13. #include "styles/style_layers.h"
  14. #include "styles/style_calls.h"
  15. namespace Calls::Group {
  16. object_ptr<Ui::GenericBox> ScreenSharingPrivacyRequestBox() {
  17. #ifdef Q_OS_MAC
  18. if (!Platform::IsMac10_15OrGreater()) {
  19. return { nullptr };
  20. }
  21. return Box([=](not_null<Ui::GenericBox*> box) {
  22. box->addRow(
  23. object_ptr<Ui::FlatLabel>(
  24. box.get(),
  25. rpl::combine(
  26. tr::lng_group_call_mac_screencast_access(),
  27. tr::lng_group_call_mac_recording()
  28. ) | rpl::map([](QString a, QString b) {
  29. auto result = Ui::Text::RichLangValue(a);
  30. result.append("\n\n").append(Ui::Text::RichLangValue(b));
  31. return result;
  32. }),
  33. st::groupCallBoxLabel),
  34. style::margins(
  35. st::boxRowPadding.left(),
  36. st::boxPadding.top(),
  37. st::boxRowPadding.right(),
  38. st::boxPadding.bottom()));
  39. box->addButton(tr::lng_group_call_mac_settings(), [=] {
  40. Platform::OpenDesktopCapturePrivacySettings();
  41. });
  42. box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
  43. });
  44. #else // Q_OS_MAC
  45. return { nullptr };
  46. #endif // Q_OS_MAC
  47. }
  48. } // namespace Calls::Group