diff --git a/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp b/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp index 99b72eb7c..2827ae70a 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp @@ -8,7 +8,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "calls/group/calls_group_rtmp.h" #include "apiwrap.h" -#include "base/event_filter.h" #include "calls/group/calls_group_common.h" #include "data/data_peer.h" #include "lang/lang_keys.h" @@ -51,14 +50,14 @@ void StartWithBox( StartRtmpProcess::FillRtmpRows( box->verticalLayout(), true, - false, std::move(showBox), std::move(showToast), std::move(data), &st::boxLabel, &st::groupCallRtmpShowButton, &st::settingsSubsectionTitle, - &st::attentionBoxButton); + &st::attentionBoxButton, + &st::defaultPopupMenu); box->setTitle(tr::lng_group_call_rtmp_title()); @@ -200,14 +199,14 @@ void StartRtmpProcess::createBox() { void StartRtmpProcess::FillRtmpRows( not_null container, bool divider, - bool disabledMenuForLabels, Fn)> showBox, Fn showToast, rpl::producer &&data, const style::FlatLabel *labelStyle, const style::IconButton *showButtonStyle, const style::FlatLabel *subsectionTitleStyle, - const style::RoundButton *attentionButtonStyle) { + const style::RoundButton *attentionButtonStyle, + const style::PopupMenu *popupMenuStyle) { struct State { rpl::variable hidden = true; rpl::variable key; @@ -253,21 +252,16 @@ void StartRtmpProcess::FillRtmpRows( return weak; }; - const auto addLabel = [&]( - rpl::producer &&text, - const style::FlatLabel &st) { + const auto addLabel = [&](rpl::producer &&text) { const auto label = container->add( - object_ptr(container, std::move(text), st), + object_ptr( + container, + std::move(text), + *labelStyle, + *popupMenuStyle), st::boxRowPadding + QMargins(0, 0, showButtonStyle->width, 0)); label->setSelectable(true); label->setBreakEverywhere(true); - if (disabledMenuForLabels) { - base::install_event_filter(label, [=](not_null e) { - return (e->type() == QEvent::ContextMenu) - ? base::EventFilterResult::Cancel - : base::EventFilterResult::Continue; - }); - } return label; }; @@ -279,7 +273,7 @@ void StartRtmpProcess::FillRtmpRows( subsectionTitleStyle); auto urlLabelContent = state->url.value(); - addLabel(std::move(urlLabelContent), *labelStyle); + addLabel(std::move(urlLabelContent)); container->add(object_ptr( container, st::groupCallRtmpUrlSkip)); @@ -313,9 +307,7 @@ void StartRtmpProcess::FillRtmpRows( }) | rpl::after_next([=] { container->resizeToWidth(container->widthNoMargins()); }); - const auto streamKeyLabel = addLabel( - std::move(keyLabelContent), - *labelStyle); + const auto streamKeyLabel = addLabel(std::move(keyLabelContent)); streamKeyLabel->setSelectable(false); const auto streamKeyButton = Ui::CreateChild( container.get(), diff --git a/Telegram/SourceFiles/calls/group/calls_group_rtmp.h b/Telegram/SourceFiles/calls/group/calls_group_rtmp.h index 37cb624ce..16c1790c2 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_rtmp.h +++ b/Telegram/SourceFiles/calls/group/calls_group_rtmp.h @@ -22,6 +22,7 @@ namespace style { struct FlatLabel; struct RoundButton; struct IconButton; +struct PopupMenu; } // namespace style namespace Calls::Group { @@ -42,14 +43,14 @@ public: static void FillRtmpRows( not_null container, bool divider, - bool disabledMenuForLabels, Fn)> showBox, Fn showToast, rpl::producer &&data, const style::FlatLabel *labelStyle, const style::IconButton *showButtonStyle, const style::FlatLabel *subsectionTitleStyle, - const style::RoundButton *attentionButtonStyle); + const style::RoundButton *attentionButtonStyle, + const style::PopupMenu *popupMenuStyle); private: void requestUrl(bool revoke); diff --git a/Telegram/SourceFiles/calls/group/calls_group_settings.cpp b/Telegram/SourceFiles/calls/group/calls_group_settings.cpp index 05a9f5035..36abc89ca 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_settings.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_settings.cpp @@ -696,7 +696,6 @@ void SettingsBox( StartRtmpProcess::FillRtmpRows( box->verticalLayout(), false, - true, [=](object_ptr &&object) { box->getDelegate()->show(std::move(object)); }, @@ -709,7 +708,8 @@ void SettingsBox( &st::groupCallBoxLabel, &st::groupCallSettingsRtmpShowButton, &st::groupCallSubsectionTitle, - &st::groupCallAttentionBoxButton); + &st::groupCallAttentionBoxButton, + &st::groupCallPopupMenu); state->data.fire(call->rtmpInfo()); } diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 5f3e04a31..1ba927023 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 5f3e04a3199c96385e80025cb8db6c5ee5260345 +Subproject commit 1ba9270234db8cbe8badbe6f6fbaea0a5869e28d