diff --git a/Telegram/SourceFiles/boxes/send_gif_with_caption_box.cpp b/Telegram/SourceFiles/boxes/send_gif_with_caption_box.cpp index b271028766..310f8fbd8e 100644 --- a/Telegram/SourceFiles/boxes/send_gif_with_caption_box.cpp +++ b/Telegram/SourceFiles/boxes/send_gif_with_caption_box.cpp @@ -226,9 +226,8 @@ namespace { } // namespace -void SendGifWithCaptionBox( +void CaptionBox( not_null box, - not_null document, not_null peer, const SendMenu::Details &details, Fn done) { @@ -237,17 +236,10 @@ void SendGifWithCaptionBox( if (!controller) { return; } - box->setTitle(tr::lng_send_gif_with_caption()); box->setWidth(st::boxWidth); box->getDelegate()->setStyle(st::sendGifBox); const auto container = box->verticalLayout(); - [[maybe_unused]] const auto gifWidget = AddGifWidget( - container, - document, - st::boxWidth); - - Ui::AddSkip(container); const auto input = AddInputField(box, controller); box->setFocusCallback([=] { @@ -339,4 +331,19 @@ void SendGifWithCaptionBox( ) | rpl::start_with_next([=] { send({}); }, input->lifetime()); } +void SendGifWithCaptionBox( + not_null box, + not_null document, + not_null peer, + const SendMenu::Details &details, + Fn done) { + box->setTitle(tr::lng_send_gif_with_caption()); + [[maybe_unused]] const auto gifWidget = AddGifWidget( + box->verticalLayout(), + document, + st::boxWidth); + Ui::AddSkip(box->verticalLayout()); + CaptionBox(box, peer, details, std::move(done)); +} + } // namespace Ui diff --git a/Telegram/SourceFiles/boxes/send_gif_with_caption_box.h b/Telegram/SourceFiles/boxes/send_gif_with_caption_box.h index 0247cf5e3d..74f6594b59 100644 --- a/Telegram/SourceFiles/boxes/send_gif_with_caption_box.h +++ b/Telegram/SourceFiles/boxes/send_gif_with_caption_box.h @@ -22,6 +22,12 @@ namespace Ui { class GenericBox; +void CaptionBox( + not_null box, + not_null peer, + const SendMenu::Details &details, + Fn done); + void SendGifWithCaptionBox( not_null box, not_null document,