From f721f5edcfeaa5f7eaf656b0cf235d82050e54d5 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sun, 6 Mar 2022 12:40:51 +0300 Subject: [PATCH] Added ability to provide style of schedule box to share box. --- Telegram/SourceFiles/boxes/share_box.cpp | 7 ++++++- Telegram/SourceFiles/boxes/share_box.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/boxes/share_box.cpp b/Telegram/SourceFiles/boxes/share_box.cpp index b411968c5..984a8316d 100644 --- a/Telegram/SourceFiles/boxes/share_box.cpp +++ b/Telegram/SourceFiles/boxes/share_box.cpp @@ -602,7 +602,12 @@ void ShareBox::submitSilent() { void ShareBox::submitScheduled() { const auto callback = [=](Api::SendOptions options) { submit(options); }; Ui::show( - HistoryView::PrepareScheduleBox(this, sendMenuType(), callback), + HistoryView::PrepareScheduleBox( + this, + sendMenuType(), + callback, + HistoryView::DefaultScheduleTime(), + _descriptor.scheduleBoxStyle), Ui::LayerOption::KeepOther); } diff --git a/Telegram/SourceFiles/boxes/share_box.h b/Telegram/SourceFiles/boxes/share_box.h index a53ba321f..b340ec5cb 100644 --- a/Telegram/SourceFiles/boxes/share_box.h +++ b/Telegram/SourceFiles/boxes/share_box.h @@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "boxes/abstract_box.h" #include "base/observer.h" #include "base/timer.h" +#include "history/view/history_view_schedule_box.h" #include "ui/chat/forward_options_box.h" #include "ui/effects/animations.h" #include "ui/effects/round_checkbox.h" @@ -92,6 +93,7 @@ public: bool show = false; bool hasCaptions = false; } forwardOptions; + HistoryView::ScheduleBoxStyleArgs scheduleBoxStyle; }; ShareBox(QWidget*, Descriptor &&descriptor);