mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-09-06 12:03:41 +02:00
Slightly improved box for writing captions to be more generic.
This commit is contained in:
parent
0e44de2fe3
commit
5b9e24f3f4
2 changed files with 22 additions and 9 deletions
|
@ -226,9 +226,8 @@ namespace {
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
void SendGifWithCaptionBox(
|
void CaptionBox(
|
||||||
not_null<Ui::GenericBox*> box,
|
not_null<Ui::GenericBox*> box,
|
||||||
not_null<DocumentData*> document,
|
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
const SendMenu::Details &details,
|
const SendMenu::Details &details,
|
||||||
Fn<void(Api::SendOptions, TextWithTags)> done) {
|
Fn<void(Api::SendOptions, TextWithTags)> done) {
|
||||||
|
@ -237,17 +236,10 @@ void SendGifWithCaptionBox(
|
||||||
if (!controller) {
|
if (!controller) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
box->setTitle(tr::lng_send_gif_with_caption());
|
|
||||||
box->setWidth(st::boxWidth);
|
box->setWidth(st::boxWidth);
|
||||||
box->getDelegate()->setStyle(st::sendGifBox);
|
box->getDelegate()->setStyle(st::sendGifBox);
|
||||||
|
|
||||||
const auto container = box->verticalLayout();
|
const auto container = box->verticalLayout();
|
||||||
[[maybe_unused]] const auto gifWidget = AddGifWidget(
|
|
||||||
container,
|
|
||||||
document,
|
|
||||||
st::boxWidth);
|
|
||||||
|
|
||||||
Ui::AddSkip(container);
|
|
||||||
|
|
||||||
const auto input = AddInputField(box, controller);
|
const auto input = AddInputField(box, controller);
|
||||||
box->setFocusCallback([=] {
|
box->setFocusCallback([=] {
|
||||||
|
@ -339,4 +331,19 @@ void SendGifWithCaptionBox(
|
||||||
) | rpl::start_with_next([=] { send({}); }, input->lifetime());
|
) | rpl::start_with_next([=] { send({}); }, input->lifetime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SendGifWithCaptionBox(
|
||||||
|
not_null<Ui::GenericBox*> box,
|
||||||
|
not_null<DocumentData*> document,
|
||||||
|
not_null<PeerData*> peer,
|
||||||
|
const SendMenu::Details &details,
|
||||||
|
Fn<void(Api::SendOptions, TextWithTags)> 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
|
} // namespace Ui
|
||||||
|
|
|
@ -22,6 +22,12 @@ namespace Ui {
|
||||||
|
|
||||||
class GenericBox;
|
class GenericBox;
|
||||||
|
|
||||||
|
void CaptionBox(
|
||||||
|
not_null<Ui::GenericBox*> box,
|
||||||
|
not_null<PeerData*> peer,
|
||||||
|
const SendMenu::Details &details,
|
||||||
|
Fn<void(Api::SendOptions, TextWithTags)> done);
|
||||||
|
|
||||||
void SendGifWithCaptionBox(
|
void SendGifWithCaptionBox(
|
||||||
not_null<Ui::GenericBox*> box,
|
not_null<Ui::GenericBox*> box,
|
||||||
not_null<DocumentData*> document,
|
not_null<DocumentData*> document,
|
||||||
|
|
Loading…
Add table
Reference in a new issue