@@ -621,7 +621,7 @@ FillMenuResult AttachSendMenuEffect(
|
||||
using namespace HistoryView::Reactions;
|
||||
const auto effect = std::make_shared<base::weak_qptr<EffectPreview>>();
|
||||
const auto position = desiredPositionOverride.value_or(QCursor::pos());
|
||||
const auto selector = (show && details.effectAllowed)
|
||||
const auto selector = details.effectAllowed
|
||||
? AttachSelectorToMenu(
|
||||
menu,
|
||||
position,
|
||||
@@ -678,6 +678,8 @@ FillMenuResult FillEditCommentPriceMenu(
|
||||
Fn<void(Action, Details)> action,
|
||||
const style::ComposeIcons *iconsOverride,
|
||||
std::optional<QPoint> desiredPositionOverride) {
|
||||
Expects(show != nullptr);
|
||||
|
||||
const auto &icons = iconsOverride
|
||||
? *iconsOverride
|
||||
: st::defaultComposeIcons;
|
||||
@@ -709,7 +711,7 @@ FillMenuResult FillEditCommentPriceMenu(
|
||||
|
||||
FillMenuResult FillSendMenu(
|
||||
not_null<Ui::PopupMenu*> menu,
|
||||
std::shared_ptr<ChatHelpers::Show> show,
|
||||
std::shared_ptr<ChatHelpers::Show> maybeShow,
|
||||
Details details,
|
||||
Fn<void(Action, Details)> action,
|
||||
const style::ComposeIcons *iconsOverride,
|
||||
@@ -725,7 +727,7 @@ FillMenuResult FillSendMenu(
|
||||
} else if (type == Type::EditCommentPrice) {
|
||||
return FillEditCommentPriceMenu(
|
||||
menu,
|
||||
show,
|
||||
maybeShow,
|
||||
details,
|
||||
action,
|
||||
iconsOverride,
|
||||
@@ -797,10 +799,10 @@ FillMenuResult FillSendMenu(
|
||||
&icons.menuPrice);
|
||||
}
|
||||
|
||||
if (show) {
|
||||
if (maybeShow) {
|
||||
return AttachSendMenuEffect(
|
||||
menu,
|
||||
show,
|
||||
maybeShow,
|
||||
details,
|
||||
action,
|
||||
desiredPositionOverride);
|
||||
@@ -812,7 +814,7 @@ FillMenuResult FillSendMenu(
|
||||
|
||||
void SetupMenuAndShortcuts(
|
||||
not_null<Ui::RpWidget*> button,
|
||||
std::shared_ptr<ChatHelpers::Show> show,
|
||||
std::shared_ptr<ChatHelpers::Show> maybeShow,
|
||||
Fn<Details()> details,
|
||||
Fn<void(Action, Details)> action,
|
||||
const style::PopupMenu *stOverride,
|
||||
@@ -824,7 +826,7 @@ void SetupMenuAndShortcuts(
|
||||
stOverride ? *stOverride : st::popupMenuWithIcons);
|
||||
const auto result = FillSendMenu(
|
||||
*menu,
|
||||
show,
|
||||
maybeShow,
|
||||
details(),
|
||||
action,
|
||||
iconsOverride);
|
||||
|
||||
@@ -89,7 +89,7 @@ struct Action {
|
||||
|
||||
FillMenuResult FillSendMenu(
|
||||
not_null<Ui::PopupMenu*> menu,
|
||||
std::shared_ptr<ChatHelpers::Show> showForEffect,
|
||||
std::shared_ptr<ChatHelpers::Show> maybeShow,
|
||||
Details details,
|
||||
Fn<void(Action, Details)> action,
|
||||
const style::ComposeIcons *iconsOverride = nullptr,
|
||||
@@ -104,7 +104,7 @@ FillMenuResult AttachSendMenuEffect(
|
||||
|
||||
void SetupMenuAndShortcuts(
|
||||
not_null<Ui::RpWidget*> button,
|
||||
std::shared_ptr<ChatHelpers::Show> show,
|
||||
std::shared_ptr<ChatHelpers::Show> maybeShow,
|
||||
Fn<Details()> details,
|
||||
Fn<void(Action, Details)> action,
|
||||
const style::PopupMenu *stOverride = nullptr,
|
||||
|
||||
Reference in New Issue
Block a user