Fixed display of default box for message schedule in correspond window.

This commit is contained in:
23rd 2024-04-18 04:02:40 +03:00 committed by John Preston
parent 3510ca7184
commit 01bfa46729
9 changed files with 12 additions and 12 deletions

View File

@ -1032,7 +1032,7 @@ void StickerSetBox::Inner::contextMenuEvent(QContextMenuEvent *e) {
_menu.get(),
type,
SendMenu::DefaultSilentCallback(sendSelected),
SendMenu::DefaultScheduleCallback(this, type, sendSelected),
SendMenu::DefaultScheduleCallback(_show, type, sendSelected),
SendMenu::DefaultWhenOnlineCallback(sendSelected));
const auto show = _show;

View File

@ -1379,7 +1379,7 @@ void FieldAutocomplete::Inner::contextMenuEvent(QContextMenuEvent *e) {
_menu,
type,
SendMenu::DefaultSilentCallback(send),
SendMenu::DefaultScheduleCallback(this, type, send),
SendMenu::DefaultScheduleCallback(_show, type, send),
SendMenu::DefaultWhenOnlineCallback(send));
if (!_menu->empty()) {

View File

@ -394,7 +394,7 @@ base::unique_qptr<Ui::PopupMenu> GifsListWidget::fillContextMenu(
menu,
type,
SendMenu::DefaultSilentCallback(send),
SendMenu::DefaultScheduleCallback(this, type, send),
SendMenu::DefaultScheduleCallback(_show, type, send),
SendMenu::DefaultWhenOnlineCallback(send),
icons);

View File

@ -1654,7 +1654,7 @@ base::unique_qptr<Ui::PopupMenu> StickersListWidget::fillContextMenu(
menu,
type,
SendMenu::DefaultSilentCallback(send),
SendMenu::DefaultScheduleCallback(this, type, send),
SendMenu::DefaultScheduleCallback(_show, type, send),
SendMenu::DefaultWhenOnlineCallback(send),
icons);

View File

@ -2183,7 +2183,7 @@ void ComposeControls::initSendButton() {
_send.get(),
[=] { return sendButtonMenuType(); },
SendMenu::DefaultSilentCallback(send),
SendMenu::DefaultScheduleCallback(_wrap.get(), sendMenuType(), send),
SendMenu::DefaultScheduleCallback(_show, sendMenuType(), send),
SendMenu::DefaultWhenOnlineCallback(send));
}

View File

@ -344,7 +344,7 @@ void Inner::contextMenuEvent(QContextMenuEvent *e) {
_menu,
type,
SendMenu::DefaultSilentCallback(send),
SendMenu::DefaultScheduleCallback(this, type, send),
SendMenu::DefaultScheduleCallback(_controller->uiShow(), type, send),
SendMenu::DefaultWhenOnlineCallback(send));
const auto item = _mosaic.itemAt(_selected);

View File

@ -34,12 +34,11 @@ Fn<void()> DefaultSilentCallback(Fn<void(Api::SendOptions)> send) {
}
Fn<void()> DefaultScheduleCallback(
not_null<Ui::RpWidget*> parent,
std::shared_ptr<Ui::Show> show,
Type type,
Fn<void(Api::SendOptions)> send) {
const auto weak = Ui::MakeWeak(parent);
return [=] {
Ui::show(
return [=, weak = Ui::MakeWeak(show->toastParent())] {
show->showBox(
HistoryView::PrepareScheduleBox(
weak,
type,

View File

@ -18,6 +18,7 @@ struct SendOptions;
namespace Ui {
class PopupMenu;
class RpWidget;
class Show;
} // namespace Ui
namespace Data {
@ -41,7 +42,7 @@ enum class FillMenuResult {
Fn<void()> DefaultSilentCallback(Fn<void(Api::SendOptions)> send);
Fn<void()> DefaultScheduleCallback(
not_null<Ui::RpWidget*> parent,
std::shared_ptr<Ui::Show> show,
Type type,
Fn<void(Api::SendOptions)> send);
Fn<void()> DefaultWhenOnlineCallback(Fn<void(Api::SendOptions)> send);

View File

@ -2046,7 +2046,7 @@ QPointer<Ui::BoxContent> ShowForwardMessagesBox(
state->menu.get(),
type,
SendMenu::DefaultSilentCallback(submit),
SendMenu::DefaultScheduleCallback(state->box, type, submit),
SendMenu::DefaultScheduleCallback(show, type, submit),
SendMenu::DefaultWhenOnlineCallback(submit));
const auto success = (result == SendMenu::FillMenuResult::Success);
if (showForwardOptions || success) {