Move SendMenu additional actions to bottom.

This commit is contained in:
John Preston 2024-06-01 22:43:19 +04:00
parent 70fe649743
commit bb79a07262

View file

@ -626,37 +626,6 @@ FillMenuResult FillSendMenu(
? *iconsOverride
: st::defaultComposeIcons;
auto toggles = false;
if (details.spoiler != SpoilerState::None) {
const auto spoilered = (details.spoiler == SpoilerState::Enabled);
menu->addAction(
(spoilered
? tr::lng_context_disable_spoiler(tr::now)
: tr::lng_context_spoiler_effect(tr::now)),
[=] { action({ .type = spoilered
? ActionType::SpoilerOff
: ActionType::SpoilerOn
}, details); },
spoilered ? &icons.menuSpoilerOff : &icons.menuSpoiler);
toggles = true;
}
if (details.caption != CaptionState::None) {
const auto above = (details.caption == CaptionState::Above);
menu->addAction(
(above
? tr::lng_caption_move_down(tr::now)
: tr::lng_caption_move_up(tr::now)),
[=] { action({ .type = above
? ActionType::CaptionDown
: ActionType::CaptionUp
}, details); },
above ? &icons.menuBelow : &icons.menuAbove);
toggles = true;
}
if (toggles && type != Type::Disabled) {
menu->addSeparator(&st::expandedMenuSeparator);
}
if (sending && type != Type::Reminder) {
menu->addAction(
tr::lng_send_silent_message(tr::now),
@ -680,6 +649,36 @@ FillMenuResult FillSendMenu(
&icons.menuWhenOnline);
}
if ((type != Type::Disabled)
&& ((details.spoiler != SpoilerState::None)
|| (details.caption != CaptionState::None))) {
menu->addSeparator(&st::expandedMenuSeparator);
}
if (details.spoiler != SpoilerState::None) {
const auto spoilered = (details.spoiler == SpoilerState::Enabled);
menu->addAction(
(spoilered
? tr::lng_context_disable_spoiler(tr::now)
: tr::lng_context_spoiler_effect(tr::now)),
[=] { action({ .type = spoilered
? ActionType::SpoilerOff
: ActionType::SpoilerOn
}, details); },
spoilered ? &icons.menuSpoilerOff : &icons.menuSpoiler);
}
if (details.caption != CaptionState::None) {
const auto above = (details.caption == CaptionState::Above);
menu->addAction(
(above
? tr::lng_caption_move_down(tr::now)
: tr::lng_caption_move_up(tr::now)),
[=] { action({ .type = above
? ActionType::CaptionDown
: ActionType::CaptionUp
}, details); },
above ? &icons.menuBelow : &icons.menuAbove);
}
using namespace HistoryView::Reactions;
const auto effect = std::make_shared<QPointer<EffectPreview>>();
const auto position = desiredPositionOverride.value_or(QCursor::pos());