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(), _menu.get(),
type, type,
SendMenu::DefaultSilentCallback(sendSelected), SendMenu::DefaultSilentCallback(sendSelected),
SendMenu::DefaultScheduleCallback(this, type, sendSelected), SendMenu::DefaultScheduleCallback(_show, type, sendSelected),
SendMenu::DefaultWhenOnlineCallback(sendSelected)); SendMenu::DefaultWhenOnlineCallback(sendSelected));
const auto show = _show; const auto show = _show;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -18,6 +18,7 @@ struct SendOptions;
namespace Ui { namespace Ui {
class PopupMenu; class PopupMenu;
class RpWidget; class RpWidget;
class Show;
} // namespace Ui } // namespace Ui
namespace Data { namespace Data {
@ -41,7 +42,7 @@ enum class FillMenuResult {
Fn<void()> DefaultSilentCallback(Fn<void(Api::SendOptions)> send); Fn<void()> DefaultSilentCallback(Fn<void(Api::SendOptions)> send);
Fn<void()> DefaultScheduleCallback( Fn<void()> DefaultScheduleCallback(
not_null<Ui::RpWidget*> parent, std::shared_ptr<Ui::Show> show,
Type type, Type type,
Fn<void(Api::SendOptions)> send); Fn<void(Api::SendOptions)> send);
Fn<void()> DefaultWhenOnlineCallback(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(), state->menu.get(),
type, type,
SendMenu::DefaultSilentCallback(submit), SendMenu::DefaultSilentCallback(submit),
SendMenu::DefaultScheduleCallback(state->box, type, submit), SendMenu::DefaultScheduleCallback(show, type, submit),
SendMenu::DefaultWhenOnlineCallback(submit)); SendMenu::DefaultWhenOnlineCallback(submit));
const auto success = (result == SendMenu::FillMenuResult::Success); const auto success = (result == SendMenu::FillMenuResult::Success);
if (showForwardOptions || success) { if (showForwardOptions || success) {