mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
Fixed display of default box for message schedule in correspond window.
This commit is contained in:
parent
3510ca7184
commit
01bfa46729
9 changed files with 12 additions and 12 deletions
|
@ -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;
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue